/// <summary> /// Gets existing document IDs by a condition. /// </summary> /// <param name="schema"></param> /// <returns></returns> public List <Guid> GetIdsByCondition(Session session, string logicalSchemaPath, ConditionExpression conditions) { List <Guid> resultIDs = new List <Guid>(); session.CurrentTransaction.AcquireSchemaLatch(logicalSchemaPath, Constants.LatchMode.Shared); var schemaInfo = _core.Schema.Parse(session, logicalSchemaPath); if (schemaInfo.Exists == false) { throw new Exception("The specified schema does not exist."); } var collection = _core.IO.GetJson <MetaDocumentCollection>(session, schemaInfo.DocumentCatalog); var workingConditions = conditions.ToWorkingConditionExpression(); foreach (var documentId in collection.Catalog) { var documentlogicalPath = schemaInfo.GetDocumentFileName(documentId); var documentFilePath = schemaInfo.GetDocumentFileName(documentId); session.CurrentTransaction.AcquireDocumentLatch(session, documentlogicalPath, Constants.LatchMode.Shared); var document = _core.IO.GetJson <MetaDocument>(session, documentFilePath); JObject jsonContent = JObject.Parse(document.Content); if (IsMatch(conditions, jsonContent)) { } } //var documentFilePath = schemaInfo.GetDocumentFileName(documentId); //var document = _core.IO.GetJson<MetaDocument>(session, documentFilePath); return(resultIDs); }