문제

I am using mongoose driver in my Node.js app and I want to know what queries mongoose run behind the scene when I call available function on mongoose model.

e.g. I am saving a signup information for a user using mongoose create function and as per its definition: it should create the document in the database with the provided information. It returns a document to the caller, so I am curious to know whether it run extra query to get the returned document or it makes it from the provided information. In the first case it will take a network bandwidth for the already available information so I want to avoid this by using any other function but I don't think it is working like this.

Anyway, please suggest me how can I see the last 10 queries that hits MongoDB Database?

도움이 되었습니까?

해결책

On the database side, you can enable Auditing, but at this time, only available on MongoDB Enterprise.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 dba.stackexchange
scroll top