The example Go snippet code that you provided should return the same result as your mongo CLI query. Could you please elaborate further the problem that you’re experiencing ?
If you would like to return back localmunicipalities.municipalcities you can project that field instead of localmunicipalities.municipality. As below example:
In addition, please note that municipalcities could be a typo of municipalities.
It looks like your application is a REST service, it would be great if you could limit the debugging scope. For example, try to debug just the function that perform the query.
If you still have further questions, could you isolate a smaller function scope and provide that as a reproducible example ?
I wasn’t able to reproduce this issue. It would be really helpful if you could create a standalone code repro that we can run locally. Also, when you say the object is empty, how are you accessing it? The Collection.Find function returns a Cursor and there’s multiple ways to iterate it, so it would be really helpful to have that code.