Using true/false vs 1/0 in MongoDB Projections — Long-Term Compatibility

Hi Everyone,

In our Go codebase, we’re building dynamic projection maps for queries. Instead of using map[string]int{"name": 1}, we’re considering using map[string]bool{"name": true} for cleaner and more expressive code.

We understand that MongoDB currently treats true and 1 equivalently in projections. However, we’d like to confirm:

  1. Is it officially supported and safe to use true/false values in projection documents long-term?
  2. Is there any risk that future MongoDB versions may stop treating true and 1 the same way?
  3. Does the MongoDB engine or Go driver perform any significant conversion overhead when using bool values in projection?

Thanks in advance — we just want to make the cleanest and safest long-term choice.