I have the following script which is valid Aggregation statement with a subquery for $nin
clause. I found it's hard to do it with Go mongo driver without first performing the sub query db.ble2.distinct("_id")
from Go code, how to do it at once with go driver?
db.ble.aggregate([
{ "$match": {
"_id": {
"$nin": db.ble2.distinct("_id")
}
}},
{"$limit": 20}
])
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…