Couchbase view on multiple columns with WHERE and ORDER BY clause as in SQL

我是研究僧i 提交于 2020-01-02 17:54:31

问题


I am new to Couchbase noSql database.

I am trying to create a view, i want this view should give result as below SQL query.

SELECT * FROM Employee e WHERE e.name = "DESM%" AND e.salary < 1000 ORDER BY e.id desc

Any suggestion is very appreciated.


回答1:


If you look at existing beer samples in Couchbase (it comes with it), you will find views defined there. In admin console you can run a view. Notice when you run a view you can provide filtering criteria and sort order for the result...that might be an equivalent for your SQL like functionality. Read more on Views and Indexes

yet another option is to use Couchbase v3 that comes with its own N1QL query language that can serve as another alternative. You can try it out online here.



来源:https://stackoverflow.com/questions/28938755/couchbase-view-on-multiple-columns-with-where-and-order-by-clause-as-in-sql

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!