Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object IDs #3

Open
tebemis opened this issue Aug 12, 2013 · 0 comments
Open

Object IDs #3

tebemis opened this issue Aug 12, 2013 · 0 comments

Comments

@tebemis
Copy link
Member

tebemis commented Aug 12, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant