Bigzhu's den

mongodb 取出表结构

bigzhu bigzhu

导入

mongorestore -h localhost:27017 -d lomo-open-db –dir ~/Documents/mo-db-2018-1-2

取出项目:

clone https://github.com/variety/variety
mongo lomoopen  --eval "var collection = 'open_company'" variety.js

就可以把结构打印出来

解释如下:

mongo  数据库 --eval "var collection = '表名'" variety.js
bigzhu
Everything is learnable