query = query.Where(entry => entry.Published);
{ $jsonSchema: { bsonType: 'object', required: [ 'Name', 'CategoryTemplateId', 'ParentCategoryId', 'PictureId', 'PageSize', 'AllowCustomersToSelectPageSize', 'ShowOnHomepage', 'IncludeInTopMenu', 'SubjectToAcl', 'LimitedToStores', 'Published', 'Deleted', 'DisplayOrder', 'CreatedOnUtc', 'UpdatedOnUtc' ], properties: { Name: { bsonType: 'string', maxLength: 400 }, MetaKeywords: { bsonType: 'string', maxLength: 400 }, MetaTitle: { bsonType: 'string', maxLength: 400 }, PriceRanges: { bsonType: 'string', maxLength: 400 }, PageSizeOptions: { bsonType: 'string', maxLength: 200 }, Description: { bsonType: 'string', maxLength: 2147483647 }, CategoryTemplateId: { bsonType: 'int' }, MetaDescription: { bsonType: 'string', maxLength: 2147483647 }, ParentCategoryId: { bsonType: 'int' }, PictureId: { bsonType: 'int' }, PageSize: { bsonType: 'int' }, AllowCustomersToSelectPageSize: { bsonType: 'bool' }, ShowOnHomepage: { bsonType: 'bool' }, IncludeInTopMenu: { bsonType: 'bool' }, SubjectToAcl: { bsonType: 'bool' }, LimitedToStores: { bsonType: 'bool' }, Published: { bsonType: 'bool' }, Deleted: { bsonType: 'bool' }, DisplayOrder: { bsonType: 'int' }, CreatedOnUtc: { bsonType: 'date' }, UpdatedOnUtc: { bsonType: 'date' } } } }
An exception of type 'System.InvalidOperationException' occurred in MongoDB.Driver.dll but was not handled in user code: 'Cannot find serializer for mtest.Category.Aggregate([{ "$match" : { "Published" : true } }]).' at MongoDB.Driver.Linq.Linq3Implementation.Serializers.KnownSerializers.KnownSerializersRegistry.GetSerializer(Expression expression, IBsonSerializer defaultSerializer) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToAggregationExpressionTranslators.ConstantExpressionToAggregationExpressionTranslator.Translate(TranslationContext context, ConstantExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToAggregationExpressionTranslators.ExpressionToAggregationExpressionTranslator.Translate(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToAggregationExpressionTranslators.MethodTranslators.AnyMethodToAggregationExpressionTranslator.Translate(TranslationContext context, MethodCallExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToAggregationExpressionTranslators.MethodCallExpressionToAggregationExpressionTranslator.Translate(TranslationContext context, MethodCallExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToAggregationExpressionTranslators.ExpressionToAggregationExpressionTranslator.Translate(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators.ExpressionToFilterTranslator.TranslateUsingAggregationOperators(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators.ExpressionToFilterTranslator.Translate(TranslationContext context, Expression expression, Boolean exprOk) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToFilterTranslators.ExpressionToFilterTranslator.TranslateLambda(TranslationContext context, LambdaExpression lambdaExpression, IBsonSerializer parameterSerializer) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.WhereMethodToPipelineTranslator.Translate(TranslationContext context, MethodCallExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.ExpressionToPipelineTranslator.Translate(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.OrderByMethodToPipelineTranslator.Translate(TranslationContext context, MethodCallExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.ExpressionToPipelineTranslator.Translate(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.OrderByMethodToPipelineTranslator.Translate(TranslationContext context, MethodCallExpression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToPipelineTranslators.ExpressionToPipelineTranslator.Translate(TranslationContext context, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.Translators.ExpressionToExecutableQueryTranslators.ExpressionToExecutableQueryTranslator.Translate[TDocument,TOutput](MongoQueryProvider`1 provider, Expression expression) at MongoDB.Driver.Linq.Linq3Implementation.MongoQuery`2.Execute() at MongoDB.Driver.Linq.Linq3Implementation.MongoQuery`2.GetEnumerator() at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)