mongodb的java开发中使用两个字段相等查询条件应该怎么写?
黄舟
黄舟 2017-04-28 09:06:01
0
1
600

也就是类似sql中的where 字段A=字段B这样的条件,我查了下网上有些帖子中写的用$where的方式我查询的时候会出错,类似于:new Document("$where",new Document("字段A", "字段B")),请教应该怎么写才对?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(1)
迷茫

Mongo does not support queries that compare two fields with each other. You can only read and compare the two fields through the program. This effect cannot be achieved in the query conditions.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template