Saturday 21 February 2015

mongoDB : drop : drop collection including indexes


Removes collection and indexes associated with it.
> db.sample.find()
{ "_id" : 1, "arr" : [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ] }
{ "_id" : 2, "arr" : [ 9, 8, 7, 6, 5, 4, 3, 2, 1 ] }
{ "_id" : 3, "arr" : [ 19, 6, 14 ] }
{ "_id" : 4, "arr" : [ 3, 6, 5, 104, 302, 161 ] }
{ "_id" : 5, "arr" : [ 1, 6, 5, 5, 4, 2 ] }
>
> db.sample.drop()
true
>
> db.sample.find()




Prevoius                                                 Next                                                 Home

No comments:

Post a Comment