本文介绍了与Couchbase中的SQL LIKE语句类似的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这在Couchbase中是否可行?

Is this possible in Couchbase??

SELECT * FROM users WHERE user_name LIKE '%john%'.

好像我必须使用startkey和endkey。但似乎没有得到正确的结果。

Seems like I have to use startkey and endkey. But doesn't seem to get the right results.

推荐答案

startKey和endKey将允许你像john%那样做。 Couchbase不允许你进行包含。

The startKey and endKey will allow you to do like "john%". Couchbase does not allow you to do a contains.

如果你真的需要一个包含,你应该使用Elastic Search插件。

If you really need a contains you should use the Elastic Search plugin.

这篇关于与Couchbase中的SQL LIKE语句类似的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-12 12:31