【发布时间】:2014-01-24 07:33:39
【问题描述】:
我有这个代码(grails):
println sortField
println sortType
domainProfileList = db.getCollection("domainProfile").find(["location.value.city" : ['$in' : location]], ["_id" : 1]).sort([sortField : sortType])
现在这部分有问题:
.sort([sortField : sortType])
key sortField 由 mongo 原样获取(即它呈现为 sortField 而不是 sortField 中存在的值,其中 sortType 呈现为 1 或 -1 )
grails 中实现此目的的正确语法是什么。
【问题讨论】:
标签: mongodb grails grails-orm grails-2.0