Hello @Florian_Silbereisen, welcome to the MongoDB Community forum!
MongoDB data is stored as documents in collections. Each document has fields and their values - it is JSON like structure. The actual data is stored in the database as BSON types.
Some comments about your document structure. A document has fields and values - and your structure has some things missing. For example, the following do not make a JSON (you are intending to create a JSON structure, and a JSON must have a field and value). See JSON.
{
"Kai"
{
"Texts"
And, this "lik": "lisa"
- it doesn’t comprehend very well. What is "lik"
? If it is a field name it needs to be meaningful to everyone who work with the structure.
There are number of field types a document can contain - string
, number
, date
, array
and object
are some of them. You can take advantage of these in building your document structure. And a document can store upto 16 MB (mega bytes) of data.
Let us take the "Pictures"
from your structure. The pictures can be stored as an array of picture information. For example:
"pictures": [
{ "url": "https://picsum.photos/200/300", "date": ISODate("2021-03-30T05:04:55.041Z") },
{ "url": "https://picsum.photos/200", "date": ISODate("2021-03-28T00:00:00Z") }
]
The pictures
field is an array, i.e., its type is array. Each element in the array is a sub-document (a.k.a. embedded document) and represents a picture’s attributes, the url
and the date
. The field type of the url
is a string and that of the date
is of type date. This structure allows that you can store dozens or hundreds or thousands of picture information within a document. Also, the MongoDB query language (MQL) allows querying these picture information efficiently.
I suggest you make your present structure a proper JSON. The usage is an aspect of how you structure the document. How are the documents structured? It is another subject, generally known as data modeling or database design (see Data modeling Introduction).
And is there some limits how many users i can save into one collection (table)?
The first question is: “How many users are you planning to store in your users
collection?”. Based on that information you can plan the storage requirements for your database. Also, see MongoDB Limits and Thresholds.