As an alternative, you could keep track of the number of fields of each document in a separate document. Suppose a document has two fields
document_1
name_field
age_field
then in a separate collection we keep track of the number of fields, using the same document id:
document_field_count
document_1
count: 2
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…