我只想知道是否可以使用水线选择特定字段,下面提供了orientdb查询。
e.g.
select phone from user
我想通过使用此查询从用户顶点中选择电话
userModel.find(phone)
.then(function(phonelist){
if(!phonelist)
console.log('msg: RECORD_NOT_FOUND');
else
console.log(phonelist);
.catch(function(err){ console.log('err: 'err'); });
是的,有可能,您只需要添加select
搜索条件,例如(假设您正在搜索ID为1的记录):
userModel.find({ select: ['phone'], id: 1 })
或者:
userModel.find({ select: ['phone'], where: { id: 1 } })
或者,如果您需要所有记录,则无需提供条件:
userModel.find({ select: ['phone'] })
这似乎没有记录在任何地方,但应该记录。在版本0.11中,也可以通过以下方式定义选择model.pick('name', 'age')
:https : //github.com/balderdashy/waterline/pull/952
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句