I have documents in two different databases: fruits, vegetables. Itβs easier for me to store databases separately.
Now suppose I want my user to search for any combination of these databases. Would it work if I ran the same query in three databases and combined the result. That is: does the order field have absolute value in the results, or does it relate to other results? For instance:
Run my db fruit query:
{ total_rows: 2, bookmark: "xxx", rows: [ { id: "Apple", order: [ 2, 220 ], fields: { title: "Apple" } }, { id: "pear", order: [ 1, 4223 ], fields: { title: "Pear" } } }
Run my query in the vegetable database:
{ total_rows: 1, bookmark: "xxx", rows: [ { id: "brocolli", order: [ 1.5, 3000 ], fields: { title: "Brocolli" } } }
Then, combining the results to create
{ total_rows: 2, bookmark: "xxx", rows: [ { id: "Apple", order: [ 2, 220 ], fields: { title: "Apple" } }, { id: "brocolli", order: [ 1.5, 3000 ], fields: { title: "Brocolli" } }, { id: "pear", order: [ 1, 4223 ], fields: { title: "Pear" } } }
Will this work? Or is it better to just create a single foods database?