Reputation: 1
I am using react-native-meteor package to connect with meteor.My Mongodb collection contains document with ObjectId. When I get the collection in react-native client side, all my ObjectId is converted to string by default. Thus making me difficult to perform operation like update from react-native client side.
When I perform insert operation in react-native client side, The insert command creates _id as string while I want _id as Object ID.
Is there any method or class in this package(react-native-meteor) to convert _id to Obejct ID in react-native client side.
Upvotes: 0
Views: 489
Reputation: 1
var ObjectID = require('mongodb').ObjectID; // convert string to ObjectID in mongodb then I am able to convert string to ObjectId in nodejs mongodb native drive.
Upvotes: 0