@codecowboy said in What is the format of the NodeBB entries in MongoDB?:
If you're new to Mongo (I am too) and thinking about the database in terms of a more traditional relational database, it can be pretty confusing.
I would recommend MongoChef over Robomongo as your client.
I'll give it a try. Any particular reason?
In the collection view, run a query like:
{ "username": { $not: { $exists: false } } }
I've been doing this kind of thing for a while now (yes, I had to get used to it xD), but I don't understand why you would do it that way. Why not simply
{ "username": { $exists: true} } }
?
That will give you all the objects whose username field is populated. As far as I understand it, there is no users table, just objects. An object can be anything and the only thing which determines what it is, is the fields / properties on that object. If the username is populated, it will be a user.
My database may be different to yours as I imported from a legacy forum but my user objects have an entry called _key which is set to a user ID. Hope that helps
Thanks
@baris said in What is the format of the NodeBB entries in MongoDB?:
Every document in the database has a
_key
field that is indexed. You can get the document describing a user with simply
db.objects.find({_key:"user:1"});
For more info see https://github.com/NodeBB/NodeBB/wiki/Database-Structure
Great, that wiki was exactly what I was looking for. I had managed to locate the posts by just playing with robomongo. This will make it easier... xD