-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Generate ObjectIDs on your end, prior to sending out a create message.
The other alternative was to have PeacefulPorcupine generate those for your, but that would almost certainly necessitate you guys doing IQs rather than just plain messages. Not sure which option is more work, for you, although having dealt with this in the past, generating ObjectIDs is fairly trivial (they don't even have to be MongoDB ObjectIDs; for example you could just use a UUID, which apparently is pretty trivial in Java http://stackoverflow.com/questions/325443/generate-uuid-in-java, and in ObjectiveC http://stackoverflow.com/questions/8684551/generate-a-uuid-string-with-arc-enabled).
http://stackoverflow.com/questions/8723229/how-to-generate-unique-object-id-in-mongodb
The one upside of going the IQ route is that you get some sort of confirmation that the object was actually created. However, in our experience this is unnecessary, as there are very few situations where the object would not be created.