博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mongoose 学习之路 ( 三 ) Query
阅读量:6899 次
发布时间:2019-06-27

本文共 827 字,大约阅读时间需要 2 分钟。

Query 查询

API详解

  • Query.prototype.where()
参数: String 或者 ObjectReturns: Query thisUser.find({age: {$gte: 20, $lte: 66}}, callback);User.where('age').gte(21).lte(77);User.find().where({name: 'zjj'});// orUser.where('age').gte(21).lte(66).where('name', 'zjj').where('friends').slice(10).exec(callback);
  • Query.prototype.equals()
参数: 对象返回: queryUser.where('age').equals(49);// 等价于User.where('age', 49);
  • Query.prototype.or()
参数: array 或 conditions返回: Query// 从两个条件中至少满足一个query.or([{color: 'res'}, {status: '1'}])
  • Query.prototype.nor()
参数: array 或 conditions返回: Query// 以下两个条件都不满足query.nor([{ color: 'green' }, { status: 'ok' }])
  • Query.prototype.and()
参数: array 或 conditions返回: Queryquery.and([{ color: 'green' }, { status: 'ok' }])

*Query.prototype.gt()

参数: String | NumberThing.find().where('age').gt(21)// orThing.find().gt('age', 21)

转载地址:http://afcdl.baihongyu.com/

你可能感兴趣的文章
11.2JS笔记
查看>>
Qt学习之路_8(Qt中与文件目录相关操作)
查看>>
vs2010中设置qt环境的智能识别方案
查看>>
开博啦
查看>>
ZOJ 1081 Points Within( 判断点在多边形内外 )
查看>>
flex模拟微信布局
查看>>
多线程测试java接口
查看>>
with 语句
查看>>
js基础知识点总结
查看>>
HTML5的新增方法
查看>>
protobuf c++例子
查看>>
eclipse中tomcat端口被占用如何解决
查看>>
通过CImageList加载图标 报错
查看>>
纯小白入手 vue3.0 CLI - 3.2 - 路由的初级使用
查看>>
安卓开发笔记——探索EventBus(转)
查看>>
对CAB文件进行数字签名
查看>>
Starting httpd:Could not reliably determine the server's fully qualified domain name
查看>>
关于Jackson默认丢失Bigdecimal精度问题分析
查看>>
什么是架构模式和架构风格
查看>>
那些年踩过的 Vue 坑(1)
查看>>