As I required to import the collection of mongodb from a bson document. How do I achieve that? and I'm using Java. Is there any API for this? Guide me through this.
Thanks in advance
As I required to import the collection of mongodb from a bson document. How do I achieve that? and I'm using Java. Is there any API for this? Guide me through this.
Thanks in advance
Try code;
DB db = m.getDB(dbname);
DBCollection dbCollection = db.getCollection(collectionName);
DBCursor cursor = dbCollection.find();
while (cursor.hasNext()){
System.out.println(cursor.next());
}