Meteor 查询本地用户集合

Meteor 查询本地用户集合,meteor,Meteor,当我在Meteor.users集合中检查特定用户时,我会得到一个包含大量信息的对象,而这些信息我并不需要 var checkResults = Meteor.users.find({username: "aaa"}); (checkResults) ? Meteor._debug(checkResults) : Meteor._debug("nothing"); 结果: collection Object { docs={...}, next_qid= 3 , querie

当我在Meteor.users集合中检查特定用户时,我会得到一个包含大量信息的对象,而这些信息我并不需要

var checkResults = Meteor.users.find({username: "aaa"});
    (checkResults) ? Meteor._debug(checkResults) : Meteor._debug("nothing");
结果:

collection
    Object { docs={...}, next_qid=   3 , queries={...}, more...}

current_snapshot
     null

docs
    Object { af8e9611-62fe-4024-81d4-1365e02992bb={...}, 5ba9f289-7fa6-4dd0-ae30-802f0c4e3138={...}}

             5ba9f289-7fa6-4dd0-ae30-802f0c4e3138 

    Object { _id= "5ba9f289-7fa6-4dd0-ae30-802f0c4e3138", username= "aaa" }

             af8e9611-62fe-4024-81d4-1365e02992bb

    Object { _id="af8e9611-62fe-4024-81d4-1365e02992bb", emails=[1], username= "ddd" }

next_qid
    3


paused
    false


queries
    Object { 1={...}, 2={...}}

_modifyAndNotify
    function()

find
    function()

findOne
    function()

insert
    function()

pauseObservers
    function()

remove
    function()

restore
    function()

resumeObservers
    function()

snapshot
    function()

update
    function()

__proto__
    Object { find=function(), findOne=function(), insert=function(), more...}

cursor_pos
    0


db_objects
    null


limit
    undefined


reactive
    true


skip
    undefined


sort_f
    null


_getRawObjects
    function()

_markAsReactive
    function()

count
    function()

fetch
    function()

forEach
    function()

map
    function()

observe
    function()

rewind
    function()

selector_f
    function()

__proto__
    Object { rewind=function(), forEach=function(), map=function(), more...}
我可以通过以下方式访问它们:

  checkResults.collection.docs[x].username 
但这并不实际,因为我需要处理结果

是否仍然可以在没有额外信息的情况下获取查询的精确对象?

Meteor.users.findOne({username:'aaa'})
返回第一个用户文档(在本例中,它应该是唯一的),如果它存在,则返回未定义的文档

如果希望检索与查询匹配的所有内容,而不需要额外的光标信息,可以执行类似于
Meteor.users.find({username:'aaa'}).fetch()的操作。

请参阅和

Meteor.users.findOne({username:'aaa'})
返回第一个用户文档(在本例中,它应该是唯一的),如果它存在,则返回未定义的文档

如果希望检索与查询匹配的所有内容,而不需要额外的光标信息,可以执行类似于
Meteor.users.find({username:'aaa'}).fetch()的操作。

看到和