Pretty neat way of defaulting object values in mongoose. Say you want to have a default proximity uuid assigned to one of your documents. Simply enclose this in a type and default definition like the one below. Added bonus of being quite readable as well.
beaconProximityUUID: {type: String, default: BEACON_PROXIMITY_UUID}
2 comments:
I was trying with the wrong command optional. The write essay for me not sure from where I got that. Anyways this is working thanks for the great help.
Hello thanks for posting this
Post a Comment