Dear Pan,
I wouldn’t worry about the material_id naming conventions. If you want to query the whole database, don’t query it based on the ID but rather by a property that is true for any material, for example:
criteria = {"structure": {'$exists': True}}
or
criteria = {"nsites": {"$gt": 0}}
However, there are very few cases where you actually want the entire database and you should think about other constraints before querying (e.g. number of atoms in the unit cell, energy above hull, etc.). Also, think about which properties are relevant in your case and only query those.
Hope this helps.
-Peter