![]() On the contrary of real files, documents have no name.ĭocuments are grouped in collections: they are nothing but a coherent grouping of similar documents you can think of them as they were folders.Īll the collections are stored within a database on which you can apply security rules, perform statistical analysis, and so on.įinally, of course, all databases will be stored (and exposed) on a host: it’s the endpoint reachable to perform queries. Documents can be queried by referencing the field names and by applying filters and sorting. The base structure is the document: here you’ll store the JSON structure of your data, with all the nested fields. Understanding the structure of a MongoDB databaseĪs we’ve already seen, there are not tables. If you’re already used Docker (or if you want to move your first steps with this technology), you can head to my article First steps with Docker: download and run MongoDB locally: in that article, I explained what is Docker, how to install it and how to use it to run MongoDB on your machine without installing the drivers.Īlternatively, if you don’t want to install Mongo on your machine, you can use the cloud version, Mongo Atlas, which offers a free tier (of course with limited resources). If you want to try MongoDB on your local machine, you can download the Community Edition from the project website and install it with a few clicks. NET, you might want to use the official MongoDB driver for C#. You can also have nested information within the same document, for example, the address, info of a user.īeing based on JSON files, you can query the documents using JS-like syntax.īut if you are working with. You don’t have a strict format as you would have with SQL databases, where everything is defined in terms of tables and columns on the contrary, you have text documents that can be expanded as you want without changing all the other documents. MongoDB is one of the most famous document database engine currently available.Ī document database is a kind of DB that, instead of storing data in tables, stores them into JSON-like documents. ![]() How to manage IDs: ObjectId and custom Id.Understanding the structure of a MongoDB database.We’ll see how to perform CRUD operations and we’ll create some advanced queries. MongoDB is a database based on JSON-like documents, but it can be queried using C#.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |