精华帖 (0) :: 良好帖 (0) :: 新手帖 (0) :: 隐藏帖 (0)
|
|||
---|---|---|---|
作者 | 正文 | ||
发表时间:2011-04-20
在mongodb中有$or 操作符的,官网中给出的例子如下: Simple: With another field The $or operator retrieves matches for each or clause individually and eliminates duplicates when returning results. A number of $or optimizations are planned for 1.8. See this thread for details. 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|||
返回顶楼 | |||
发表时间:2011-04-20
最后修改:2011-04-20
happy90 写道
在mongodb中有$or 操作符的,官网中给出的例子如下: Simple: With another field The $or operator retrieves matches for each or clause individually and eliminates duplicates when returning results. A number of $or optimizations are planned for 1.8. See this thread for details.
BasicDBObject query = new BasicDBObject(); BasicDBObject or_query = new BasicDBObject(); or_query.append("name","kk"); or_query.append("age",30); query.append("$or", or_query);
|
|||
返回顶楼 | |||
发表时间:2011-04-20
经过不断的寻找,我终于找到答案了,下面和大家一起分享:
以上的mongoDB语法对应到sql就是
|
|||
返回顶楼 | |||
发表时间:2011-04-20
List里丢几个BasicDBObject 与一个 BasicDBObject 里丢几个BasicDBObject
没有任何区别 |
|||
返回顶楼 | |||
浏览 2185 次