|
|
|
@ -20,9 +20,9 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations |
|
|
|
{ |
|
|
|
internal sealed class QueryIdsAsync : OperationBase |
|
|
|
{ |
|
|
|
private readonly Lazy<string> idField = new Lazy<string>(GetIdField); |
|
|
|
private readonly Lazy<string> schemaIdField = new Lazy<string>(GetSchemaIdField); |
|
|
|
private static readonly List<(Guid SchemaId, Guid Id)> EmptyIds = new List<(Guid SchemaId, Guid Id)>(); |
|
|
|
private static readonly Lazy<string> IdField = new Lazy<string>(GetIdField); |
|
|
|
private static readonly Lazy<string> SchemaIdField = new Lazy<string>(GetSchemaIdField); |
|
|
|
private readonly IAppProvider appProvider; |
|
|
|
|
|
|
|
public QueryIdsAsync(IAppProvider appProvider) |
|
|
|
@ -52,7 +52,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations |
|
|
|
await Collection.Find(filter).Only(x => x.Id, x => x.IndexedSchemaId) |
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
return contentEntities.Select(x => (Guid.Parse(x[schemaIdField.Value].AsString), Guid.Parse(x[idField.Value].AsString))).ToList(); |
|
|
|
return contentEntities.Select(x => (Guid.Parse(x[SchemaIdField.Value].AsString), Guid.Parse(x[IdField.Value].AsString))).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
public async Task<IReadOnlyList<(Guid SchemaId, Guid Id)>> DoAsync(Guid appId, Guid schemaId, FilterNode<ClrValue> filterNode) |
|
|
|
@ -70,7 +70,7 @@ namespace Squidex.Domain.Apps.Entities.MongoDb.Contents.Operations |
|
|
|
await Collection.Find(filter).Only(x => x.Id, x => x.IndexedSchemaId) |
|
|
|
.ToListAsync(); |
|
|
|
|
|
|
|
return contentEntities.Select(x => (Guid.Parse(x[schemaIdField.Value].AsString), Guid.Parse(x[idField.Value].AsString))).ToList(); |
|
|
|
return contentEntities.Select(x => (Guid.Parse(x[SchemaIdField.Value].AsString), Guid.Parse(x[IdField.Value].AsString))).ToList(); |
|
|
|
} |
|
|
|
|
|
|
|
public static FilterDefinition<MongoContentEntity> BuildFilter(FilterNode<ClrValue>? filterNode, Guid schemaId) |
|
|
|
|