1

I have a mongo db with companies with the following data structure:

{'Beschreibung': [],
 'Branche': ['Doctor'],
 'Homepage': 'http://www.doctorsdomain.de',
 'Mail': None,
 'Name': ['Companyname'],
 'Ort': 'Doctors City',
 'PLZ': '12345 ',
 'StrHausnummer': 'Doctors Street',
 'Telefonnummer': '1235345646',
 '_id': ObjectId('sadfsdfawdfawedfbad5f'),
 'domain': 'doctorsdomain',
 'doctors': [{'Salutation': 'Dear Madame', 'Name': 'Maximiliane Mustermann'},
                    {'Salutation': 'Dear Mister', 'Name': 'Bernd Beispiel'}],
'other information'

I don't find the query to count how many names (doctors) I have in my database.

I tried something like

collection.find({"doctors":{"$exists":1}}).count() 

but than I only get the number of the companies where doctors exists.

Need help please!

Thanks a lot!

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.