JSON referencing MongoDB ObjectID

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

JSON referencing MongoDB ObjectID

I'm working with a company that uses MongoDB and their specs for push JSON to
their endpoint includes an ObjectId("3023493820") whatever. I've done some
Googling put I'm still not sure how I would work in that mongo class object
using JSON.stringify. Any suggestions?

Sent from: http://apache-flex-users.2333346.n4.nabble.com/
Reply | Threaded
Open this post in threaded view

Re: JSON referencing MongoDB ObjectID

Olaf Krueger
IIRIC, the MongoDB ObjectId is typed as BSON.
To learn a bit more about the MongoDB ObjectId, maybe this is helpful

Even if it seems that it's not the case for you, maybe this [3] helps to
understand that "the _id doesn't necessarily have to be an ObjectID."

I found an AS3 implementation of BSON, but I never checked it out, so I
don't know if it works [4].

There are also some outdated MongoDB AS3 drivers out there [5][6][7][8],
maybe you could use parts of if. I guess [6][7][8] would be very helpful
because they proivide an ObjectId class!

Hope this helps,

[1] https://docs.mongodb.com/manual/reference/method/ObjectId/
[2] https://docs.mongodb.com/manual/reference/bson-types/#objectid
[3] https://github.com/mongodb/mongo-php-library/issues/217
[5] https://github.com/s9tpepper/MongoAS3
[7] http://words.transmote.com/wp/20120402/mongodb-objectid-for-as3/
[8] https://gist.github.com/ericsoco/2287723

Sent from: http://apache-flex-users.2333346.n4.nabble.com/