'collection.toArray()' method convert the collection into an array of documents. Since it creates a copy of collection in the system RAM do not use this method in production environments.
127.0.0.1:8529@abc_org> db.user.toArray() [ { "_key" : "17089", "_id" : "user/17089", "_rev" : "_cRe1GKq---", "id" : 1, "firstName" : "Sailu", "lastName" : "Ptr", "age" : 32 }, { "_key" : "17091", "_id" : "user/17091", "_rev" : "_cRe1GKu---", "id" : 2, "firstName" : "Gopi", "lastName" : "Battu", "age" : 33 }, { "_key" : "17093", "_id" : "user/17093", "_rev" : "_cRe1GKy---", "id" : 3, "firstName" : "Krishna", "lastName" : "Gurram", "age" : 32 }, { "_key" : "17095", "_id" : "user/17095", "_rev" : "_cRe1H-6---", "id" : 4, "firstName" : "Venkat", "lastName" : "Ptr", "age" : 35 } ]
No comments:
Post a Comment