Database

db={"workflow":[{"_id":1,"name":"Workflow 1","connections":[1,2]},{"_id":2,"name":"Workflow 2","connections":[3,4]}],"connection":[{"_id":1,"name":"Connection 1"},{"_id":2,"name":"Connection 2"},{"_id":3,"name":"Connection 3"},{"_id":4,"name":"Connection 4"},{"_id":5,"name":"Connection 5"},{"_id":6,"name":"Connection 6"}]}

Query

db.connection.aggregate([{$lookup:{from:"workflow",let:{c_id:"$_id"},as:"connections",pipeline:[{$match:{$expr:{$in:["$$c_id","$connections"]}}}]}},{$match:{connections:{$eq:[]}}},{$project:{_id:1,name:1}}])

Result