mongoDB中sql中的union是什么
我想要mongoDB中sql中的union是什么,sql,mongodb,union,Sql,Mongodb,Union,我想要union查询结果: db.links.aggregate({$unwind:"$comments"},{$project:{ votes:{$subtract:["$comments.upVotes", "$comments.downVotes"]} } }) db.links.aggregate({$unwind:"$comments"},{$unwind:"$comments.replies"},{$project:{ votes:{$subtract:["$comments.r
union
查询结果:
db.links.aggregate({$unwind:"$comments"},{$project:{ votes:{$subtract:["$comments.upVotes", "$comments.downVotes"]} } })
db.links.aggregate({$unwind:"$comments"},{$unwind:"$comments.replies"},{$project:{ votes:{$subtract:["$comments.replies.upVotes", "$comments.replies.downVotes"]} } })
但我找不到任何答案
sql
中的union
示例:
(selectcourse_id from section where sem = ‘Fall’ and year = 2009)
union
(selectcourse_id from section where sem = ‘Spring’ and year = 2010)
这个查询返回部分位于
(sem='Fall'和year=2009)
或(sem='Spring'和year=2010)
您能更好地解释一下您的问题吗?也许这篇文章可以帮到您不。它不同于or和union