NOSQL – POUCHDB structure

I am a new feature of the nosql concept, so when I started to learn PouchDB, I found this conversion diagram. My confusion is, if I say that I have multiple tables, how Dealing with PouchDB, does this mean I need to create multiple databases? Because from my understanding in pouchdb, a database can store many documents, but a document means a row in sql or am I misunderstood?

… does it mean that i need to create multiple databases?

blockquote>

No.

… a document mean a row in sql or am i misunderstood?

That By the way. The SQL table defines the column headings (name and type) – this is the JSON attribute name of the document.

So, all documents (rows) with the same attribute (the so-called “schema”) are the same as yours SQL tables are equivalent. You can have as many schemas as you need in a database (please visit json-schema.org for inspiration).

How to request separately? Create a CouchDB view! You can get all/some “rows” of tabular data (documents with the same schema) from SQL.

In order to write these views conveniently, the attribute types of CouchDB documents are very common. Your SQL The known name in the table can be your type, such as doc.type: “animal”

Your view name may be animalByName or animalByWeight. It depends on your needs.

I am a new feature of the nosql concept, so when I started to learn PouchDB, I found this conversion graph. My confusion is, if I say that I have multiple tables, how to deal with PouchDB, Does this mean I need to create multiple databases? Because from my understanding in pouchdb, a database can store many documents, but a document means a row in sql or am I misunderstood?

… does it mean that i need to create multiple databases?

No.

< p>

… a document mean a row in sql or am i misunderstood?

That’s right. SQL table defines column headings (name and type ) – This is the JSON attribute name of the document.

So, all documents (rows) with the same attributes (the so-called “schema”) are equivalent to your SQL table. You can in a database as needed Have as many schemas as possible (please visit json-schema.org for inspiration).

How to request separately? Create a CouchDB view! You can get all/some “rows” of tabular data (documents with the same schema) from SQL.

In order to write these views conveniently, the attribute types of CouchDB documents are very common. Your SQL The known name in the table can be your type, such as doc.type: “animal”

Your view name may be animalByName or animalByWeight. It depends on your needs.

Leave a Comment

Your email address will not be published.