mongoose how to get all collection
PHP中文网
PHP中文网 2017-05-17 10:03:06
0
2
732

I need to count all the collections in the data. Which collection contains the most data? How to deal with it.
The mongoose I see uses model to process the corresponding collection. There is a large amount of data that has been imported into the database. How do I get the collection?

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(2)
phpcn_u1582

Get the list of collections:

1. Use node-mongodb-native driven listCollections

http://mongodb.github.io/node...

2. The connection in Mongoose also inherits the above native driver:

https://github.com/Automattic...

mongoose.connection.db.listCollections()

Contains the largest Collection:

You need to count and sort by yourself

For reference.

Love MongoDB! Have fun!

给我你的怀抱

show tables

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template