比较 Mongoid 中的单独列
我正在寻找相当于以下内容的 mongoid: 如何在 Oracle 中选择两列作为一列进行比较
我可以'似乎找不到任何比较同一查询中的列的文档或示例。这在 Mongoid 中是不可能的吗?
I'm looking for the mongoid equivalent to:
How to select the comparison of two columns as one column in Oracle
I can't seem to find any documentation or examples comparing columns within the same query. Is this just not possible in Mongoid?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,您需要下拉到 mongodb ruby 驱动程序来执行此操作,并且它可能会非常慢,因为它是一个不会使用索引的 javascript 查询:
这相当于此处的第三个 shell 命令。
: 注意:如果文档没有键
name
并且该文档也没有键name2
,这将返回 true,因为 null == null。Nope, you need to drop down to the mongodb ruby driver to do this and it will potentially be very slow as it is a javascript query that will not use an index:
Which is equivalent to third shell command here.:
Note: if a document does not have key
name
and that same document also does not have keyname2
that this will return true because null == null.