什么是mongoose中的db.collection.stats()命令? [英] What is the db.collection.stats() command in mongoose?

查看:684
本文介绍了什么是mongoose中的db.collection.stats()命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想检查一个集合的信息,就像 db.collection.stats()命令在源MongoDB

I want to check one collection's information just like the db.collection.stats() command in origin MongoDB

我如何在模式或模型上的mongoose中做它?

How can I do it in mongoose on schema or on model?

推荐答案

有同样的问题,方式:

 YourModel.collection.stats(callback);

您基本上访问了 Model 接口通过集合属性(这不是集合名称,而是实际上称为集合的属性)。然后,您可以使用此对象上的任何原生函数。

You basically access a Model's native interface via the collection property (this is not the collection name, but a property in fact called collection). You can then use any native functions on this object.

这篇关于什么是mongoose中的db.collection.stats()命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆