I am creating one application where for each product I have one database and I will create another document based on the date. The keys in the documents may vary and depend on the user that he provides. Suppose the user will give the same tracking key with a changed value over time. In the end, I need to know all the possible keys before creating automatic views on them.
Example: If I had a database, say, a test. It contains, say, two documents,
1. {
"_id": "1",
"_rev": "1-"
"type": "Note",
"content": "Hello World!"
}
2. {
"_id": "2",
"_rev": "1-"
"type": "Note",
"content": "Beyond Hello World!",
"extra": "Boom"
}
Then I want to list all the keys in this database. So the answer should be _id, _rev, type, content and extra.
These keys are dynamic and user dependent. Therefore, I could not assume that I knew them beforehand.
source share