0
编辑:想通了如何查询数组。这些查询是否有效?
如何查询带点概念的对象中的字段?
attributes:
colors: 'red'
collection.findOne {attributes.colors:'red'}, (doc) ->
#returns that doc
编辑:想通了如何查询数组。这些查询是否有效?
如何查询带点概念的对象中的字段?
attributes:
colors: 'red'
collection.findOne {attributes.colors:'red'}, (doc) ->
#returns that doc
你需要引用一个点的属性在里面:
collection.findOne 'attributes.colors': 'red', (doc) ->
# returns that doc