var filterBuilder = Builders<WorkflowInstance>.Filter; var filter = filterBuilder.Eq("WorkflowCode", workflowCode) & filterBuilder.Eq("InstanceStatus" ...
var filterBuilder = Builders<WorkflowInstance>.Filter;
var filter = filterBuilder.Eq("WorkflowCode", workflowCode)
& filterBuilder.Eq("InstanceStatus", "WIP")
& filterBuilder.ElemMatch("WorkflowStateInstanceList", Builders<WorkflowStateInstance>.Filter.ElemMatch("ApproverUserList", Builders<InstanceStateApprover>.Filter.Eq("ApproverUser", userID))
& Builders<WorkflowStateInstance>.Filter.Eq("StateStatus", "WIP"));
List<WorkflowInstance> listInstance = InstanceMongo.Collection.Find(filter).ToList();
註:WorkflowInstance/WorkflowStateInstance/InstanceStateApprover 為與Mongo對應的C#實體類