// produce a Device wrapper suitable for passing in an Upsert() as
// '$set' fields
produce a Device wrapper suitable for passing in an Upsert() as
'$set' fields
// produce a Device wrapper suitable for passing in an Upsert () as // ' $set ' fields
func genDeviceUpdate(dev *Device) *Device {
	updev := Device{}
	if dev.Status != "" {
		updev.Status = dev.Status
	}
	if dev.Key != "" {
		updev.Key = dev.Key
	}
	if dev.DeviceIdentity != "" {
		updev.DeviceIdentity = dev.DeviceIdentity
	}
	if len(dev.Attributes) != 0 {
		updev.Attributes = dev.Attributes
	}
	if dev.RequestTime != nil {
		updev.RequestTime = dev.RequestTime
	}
	return &updev
}
func genDeviceUpdate ( dev * Device ) * Device { updev := Device { } if dev . Status != " " { updev . Status = dev . Status } if dev . Key != " " { updev . Key = dev . Key } if dev . DeviceIdentity != " " { updev . DeviceIdentity = dev . DeviceIdentity } if len ( dev . Attributes ) != 0 { updev . Attributes = dev . Attributes } if dev . RequestTime != nil { updev . RequestTime = dev . RequestTime } return & updev }
produce a Device wrapper suitable for passing in an Upsert() as
'$set' fields
produce a Device wrapper suitable for passing in an Upsert () as ' $set ' fields
// TODO: should attributes be merged?