MongoDB: how to count number of keys in a document?

后端 未结 7 1527
一向
一向 2020-12-11 14:46

Lets say a document is :

{

a: 1,
b: 1,
c: 2,
 ....
z: 2
}

How can I count the number of keys in such document?

Thank you

7条回答
提交回复
热议问题