├── .github ├── PULL_REQUEST_TEMPLATE.md ├── dco.yml └── workflows │ └── project.yml ├── .gitignore ├── .mvn ├── extensions.xml ├── jvm.config └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── CI.adoc ├── CONTRIBUTING.adoc ├── Jenkinsfile ├── LICENSE.txt ├── README.adoc ├── SECURITY.adoc ├── ci ├── README.adoc ├── openjdk24-mongodb-8.0 │ └── Dockerfile ├── pipeline.properties └── start-replica.sh ├── lombok.config ├── mvnw ├── mvnw.cmd ├── pom.xml ├── settings.xml ├── spring-data-mongodb-distribution ├── package.json └── pom.xml ├── spring-data-mongodb ├── Spring Data MongoDB.sonargraph ├── etc │ └── eclipse-formatter.xml ├── pom.xml └── src │ ├── jmh │ └── java │ │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ ├── core │ │ ├── ProjectionsBenchmark.java │ │ └── convert │ │ │ ├── DbRefMappingBenchmark.java │ │ │ └── MappingMongoConverterBenchmark.java │ │ ├── microbenchmark │ │ ├── AbstractMicrobenchmark.java │ │ ├── HttpResultsWriter.java │ │ ├── MongoResultsWriter.java │ │ └── ResultsWriter.java │ │ └── repository │ │ ├── AotRepositoryBenchmark.java │ │ ├── SmallerPersonRepository.java │ │ └── SmallerRepositoryBenchmark.java │ ├── main │ ├── java │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── mongodb │ │ │ ├── BindableMongoExpression.java │ │ │ ├── BulkOperationException.java │ │ │ ├── ClientSessionException.java │ │ │ ├── CodecRegistryProvider.java │ │ │ ├── DefaultMongoTransactionOptionsResolver.java │ │ │ ├── InvalidMongoDbApiUsageException.java │ │ │ ├── LazyLoadingException.java │ │ │ ├── MongoCollectionUtils.java │ │ │ ├── MongoDatabaseFactory.java │ │ │ ├── MongoDatabaseUtils.java │ │ │ ├── MongoExpression.java │ │ │ ├── MongoManagedTypes.java │ │ │ ├── MongoResourceHolder.java │ │ │ ├── MongoSessionProvider.java │ │ │ ├── MongoTransactionException.java │ │ │ ├── MongoTransactionManager.java │ │ │ ├── MongoTransactionOptions.java │ │ │ ├── MongoTransactionOptionsResolver.java │ │ │ ├── ReactiveMongoDatabaseFactory.java │ │ │ ├── ReactiveMongoDatabaseUtils.java │ │ │ ├── ReactiveMongoResourceHolder.java │ │ │ ├── ReactiveMongoTransactionManager.java │ │ │ ├── SessionAwareMethodInterceptor.java │ │ │ ├── SessionSynchronization.java │ │ │ ├── SimpleMongoTransactionOptions.java │ │ │ ├── SpringDataMongoDB.java │ │ │ ├── TransactionMetadata.java │ │ │ ├── TransactionOptionResolver.java │ │ │ ├── TransientClientSessionException.java │ │ │ ├── TransientMongoDbException.java │ │ │ ├── UncategorizedMongoDbException.java │ │ │ ├── aot │ │ │ ├── LazyLoadingProxyAotProcessor.java │ │ │ ├── MongoAotPredicates.java │ │ │ ├── MongoAotReflectionHelper.java │ │ │ ├── MongoManagedTypesBeanRegistrationAotProcessor.java │ │ │ └── MongoRuntimeHints.java │ │ │ ├── config │ │ │ ├── AbstractMongoClientConfiguration.java │ │ │ ├── AbstractReactiveMongoConfiguration.java │ │ │ ├── BeanNames.java │ │ │ ├── ConnectionStringPropertyEditor.java │ │ │ ├── EnableMongoAuditing.java │ │ │ ├── EnableReactiveMongoAuditing.java │ │ │ ├── GeoJsonConfiguration.java │ │ │ ├── GridFsTemplateParser.java │ │ │ ├── MappingMongoConverterParser.java │ │ │ ├── MongoAuditingBeanDefinitionParser.java │ │ │ ├── MongoAuditingRegistrar.java │ │ │ ├── MongoClientParser.java │ │ │ ├── MongoConfigurationSupport.java │ │ │ ├── MongoCredentialPropertyEditor.java │ │ │ ├── MongoDbFactoryParser.java │ │ │ ├── MongoNamespaceHandler.java │ │ │ ├── MongoParsingUtils.java │ │ │ ├── MongoTemplateParser.java │ │ │ ├── PersistentEntitiesFactoryBean.java │ │ │ ├── ReactiveMongoAuditingRegistrar.java │ │ │ ├── ReadConcernPropertyEditor.java │ │ │ ├── ReadPreferencePropertyEditor.java │ │ │ ├── ServerAddressPropertyEditor.java │ │ │ ├── StringToWriteConcernConverter.java │ │ │ ├── UUidRepresentationPropertyEditor.java │ │ │ ├── WriteConcernPropertyEditor.java │ │ │ └── package-info.java │ │ │ ├── core │ │ │ ├── AggregationUtil.java │ │ │ ├── BulkOperations.java │ │ │ ├── BulkOperationsSupport.java │ │ │ ├── ChangeStreamEvent.java │ │ │ ├── ChangeStreamOptions.java │ │ │ ├── CollectionCallback.java │ │ │ ├── CollectionOptions.java │ │ │ ├── CollectionPreparer.java │ │ │ ├── CollectionPreparerSupport.java │ │ │ ├── CountQuery.java │ │ │ ├── CursorPreparer.java │ │ │ ├── DbCallback.java │ │ │ ├── DefaultBulkOperations.java │ │ │ ├── DefaultIndexOperations.java │ │ │ ├── DefaultIndexOperationsProvider.java │ │ │ ├── DefaultReactiveBulkOperations.java │ │ │ ├── DefaultReactiveIndexOperations.java │ │ │ ├── DefaultScriptOperations.java │ │ │ ├── DefaultWriteConcernResolver.java │ │ │ ├── DocumentCallbackHandler.java │ │ │ ├── EncryptionAlgorithms.java │ │ │ ├── EntityLifecycleEventDelegate.java │ │ │ ├── EntityOperations.java │ │ │ ├── EntityResultConverter.java │ │ │ ├── ExecutableAggregationOperation.java │ │ │ ├── ExecutableAggregationOperationSupport.java │ │ │ ├── ExecutableFindOperation.java │ │ │ ├── ExecutableFindOperationSupport.java │ │ │ ├── ExecutableInsertOperation.java │ │ │ ├── ExecutableInsertOperationSupport.java │ │ │ ├── ExecutableMapReduceOperation.java │ │ │ ├── ExecutableMapReduceOperationSupport.java │ │ │ ├── ExecutableRemoveOperation.java │ │ │ ├── ExecutableRemoveOperationSupport.java │ │ │ ├── ExecutableUpdateOperation.java │ │ │ ├── ExecutableUpdateOperationSupport.java │ │ │ ├── FindAndModifyOptions.java │ │ │ ├── FindAndReplaceOptions.java │ │ │ ├── FindPublisherPreparer.java │ │ │ ├── FluentMongoOperations.java │ │ │ ├── GeoCommandStatistics.java │ │ │ ├── HintFunction.java │ │ │ ├── IndexConverters.java │ │ │ ├── MappedDocument.java │ │ │ ├── MappingMongoJsonSchemaCreator.java │ │ │ ├── MongoAction.java │ │ │ ├── MongoActionOperation.java │ │ │ ├── MongoAdmin.java │ │ │ ├── MongoAdminOperations.java │ │ │ ├── MongoClientFactoryBean.java │ │ │ ├── MongoClientSettingsFactoryBean.java │ │ │ ├── MongoDataIntegrityViolationException.java │ │ │ ├── MongoDatabaseFactorySupport.java │ │ │ ├── MongoEncryptionSettingsFactoryBean.java │ │ │ ├── MongoExceptionTranslator.java │ │ │ ├── MongoJsonSchemaCreator.java │ │ │ ├── MongoOperations.java │ │ │ ├── MongoServerApiFactoryBean.java │ │ │ ├── MongoTemplate.java │ │ │ ├── PropertyOperations.java │ │ │ ├── QueryOperations.java │ │ │ ├── QueryResultConverter.java │ │ │ ├── ReactiveAggregationOperation.java │ │ │ ├── ReactiveAggregationOperationSupport.java │ │ │ ├── ReactiveBulkOperations.java │ │ │ ├── ReactiveChangeStreamOperation.java │ │ │ ├── ReactiveChangeStreamOperationSupport.java │ │ │ ├── ReactiveCollectionCallback.java │ │ │ ├── ReactiveDatabaseCallback.java │ │ │ ├── ReactiveFindOperation.java │ │ │ ├── ReactiveFindOperationSupport.java │ │ │ ├── ReactiveFluentMongoOperations.java │ │ │ ├── ReactiveInsertOperation.java │ │ │ ├── ReactiveInsertOperationSupport.java │ │ │ ├── ReactiveMapReduceOperation.java │ │ │ ├── ReactiveMapReduceOperationSupport.java │ │ │ ├── ReactiveMongoClientFactoryBean.java │ │ │ ├── ReactiveMongoContext.java │ │ │ ├── ReactiveMongoOperations.java │ │ │ ├── ReactiveMongoTemplate.java │ │ │ ├── ReactiveRemoveOperation.java │ │ │ ├── ReactiveRemoveOperationSupport.java │ │ │ ├── ReactiveSessionCallback.java │ │ │ ├── ReactiveSessionScoped.java │ │ │ ├── ReactiveUpdateOperation.java │ │ │ ├── ReactiveUpdateOperationSupport.java │ │ │ ├── ReadConcernAware.java │ │ │ ├── ReadPreferenceAware.java │ │ │ ├── ReplaceOptions.java │ │ │ ├── ScriptOperations.java │ │ │ ├── ScrollUtils.java │ │ │ ├── SessionCallback.java │ │ │ ├── SessionScoped.java │ │ │ ├── SimpleMongoClientDatabaseFactory.java │ │ │ ├── SimpleReactiveMongoDatabaseFactory.java │ │ │ ├── SortingQueryCursorPreparer.java │ │ │ ├── ViewOptions.java │ │ │ ├── WriteConcernAware.java │ │ │ ├── WriteConcernResolver.java │ │ │ ├── WriteResultChecking.java │ │ │ ├── aggregation │ │ │ │ ├── AbstractAggregationExpression.java │ │ │ │ ├── AccumulatorOperators.java │ │ │ │ ├── AddFieldsOperation.java │ │ │ │ ├── Aggregation.java │ │ │ │ ├── AggregationExpression.java │ │ │ │ ├── AggregationExpressionCriteria.java │ │ │ │ ├── AggregationExpressionTransformer.java │ │ │ │ ├── AggregationOperation.java │ │ │ │ ├── AggregationOperationContext.java │ │ │ │ ├── AggregationOperationRenderer.java │ │ │ │ ├── AggregationOptions.java │ │ │ │ ├── AggregationPipeline.java │ │ │ │ ├── AggregationResults.java │ │ │ │ ├── AggregationSpELExpression.java │ │ │ │ ├── AggregationUpdate.java │ │ │ │ ├── AggregationUtils.java │ │ │ │ ├── AggregationVariable.java │ │ │ │ ├── ArithmeticOperators.java │ │ │ │ ├── ArrayOperators.java │ │ │ │ ├── BasicAggregationOperation.java │ │ │ │ ├── BooleanOperators.java │ │ │ │ ├── BucketAutoOperation.java │ │ │ │ ├── BucketOperation.java │ │ │ │ ├── BucketOperationSupport.java │ │ │ │ ├── ComparisonOperators.java │ │ │ │ ├── ConditionalOperators.java │ │ │ │ ├── ConvertOperators.java │ │ │ │ ├── CountOperation.java │ │ │ │ ├── DataTypeOperators.java │ │ │ │ ├── DateOperators.java │ │ │ │ ├── DensifyOperation.java │ │ │ │ ├── DocumentEnhancingOperation.java │ │ │ │ ├── DocumentOperators.java │ │ │ │ ├── EvaluationOperators.java │ │ │ │ ├── ExposedFields.java │ │ │ │ ├── ExposedFieldsAggregationOperationContext.java │ │ │ │ ├── FacetOperation.java │ │ │ │ ├── Field.java │ │ │ │ ├── FieldLookupPolicy.java │ │ │ │ ├── Fields.java │ │ │ │ ├── FieldsExposingAggregationOperation.java │ │ │ │ ├── GeoNearOperation.java │ │ │ │ ├── GraphLookupOperation.java │ │ │ │ ├── GroupOperation.java │ │ │ │ ├── InheritingExposedFieldsAggregationOperationContext.java │ │ │ │ ├── LimitOperation.java │ │ │ │ ├── LiteralOperators.java │ │ │ │ ├── LookupOperation.java │ │ │ │ ├── MatchOperation.java │ │ │ │ ├── MergeOperation.java │ │ │ │ ├── NestedDelegatingExpressionAggregationOperationContext.java │ │ │ │ ├── ObjectOperators.java │ │ │ │ ├── OutOperation.java │ │ │ │ ├── PrefixingDelegatingAggregationOperationContext.java │ │ │ │ ├── ProjectionOperation.java │ │ │ │ ├── RedactOperation.java │ │ │ │ ├── RelaxedTypeBasedAggregationOperationContext.java │ │ │ │ ├── ReplaceRootOperation.java │ │ │ │ ├── ReplaceWithOperation.java │ │ │ │ ├── SampleOperation.java │ │ │ │ ├── ScriptOperators.java │ │ │ │ ├── SelectionOperators.java │ │ │ │ ├── SetOperation.java │ │ │ │ ├── SetOperators.java │ │ │ │ ├── SetWindowFieldsOperation.java │ │ │ │ ├── SkipOperation.java │ │ │ │ ├── SortByCountOperation.java │ │ │ │ ├── SortOperation.java │ │ │ │ ├── SpelExpressionTransformer.java │ │ │ │ ├── StringOperators.java │ │ │ │ ├── SystemVariable.java │ │ │ │ ├── TypeBasedAggregationOperationContext.java │ │ │ │ ├── TypedAggregation.java │ │ │ │ ├── UnionWithOperation.java │ │ │ │ ├── UnsetOperation.java │ │ │ │ ├── UnwindOperation.java │ │ │ │ ├── VariableOperators.java │ │ │ │ ├── VectorSearchOperation.java │ │ │ │ └── package-info.java │ │ │ ├── annotation │ │ │ │ ├── Collation.java │ │ │ │ └── package-info.java │ │ │ ├── convert │ │ │ │ ├── AbstractMongoConverter.java │ │ │ │ ├── DbRefProxyHandler.java │ │ │ │ ├── DbRefResolver.java │ │ │ │ ├── DbRefResolverCallback.java │ │ │ │ ├── DefaultDbRefProxyHandler.java │ │ │ │ ├── DefaultDbRefResolver.java │ │ │ │ ├── DefaultDbRefResolverCallback.java │ │ │ │ ├── DefaultMongoTypeMapper.java │ │ │ │ ├── DefaultReferenceResolver.java │ │ │ │ ├── DocumentAccessor.java │ │ │ │ ├── DocumentPointerFactory.java │ │ │ │ ├── DocumentPropertyAccessor.java │ │ │ │ ├── DocumentReferenceSource.java │ │ │ │ ├── GeoConverters.java │ │ │ │ ├── JsonSchemaMapper.java │ │ │ │ ├── LazyLoadingProxy.java │ │ │ │ ├── LazyLoadingProxyFactory.java │ │ │ │ ├── MappingMongoConverter.java │ │ │ │ ├── MongoConversionContext.java │ │ │ │ ├── MongoConverter.java │ │ │ │ ├── MongoConverters.java │ │ │ │ ├── MongoCustomConversions.java │ │ │ │ ├── MongoDatabaseFactoryReferenceLoader.java │ │ │ │ ├── MongoExampleMapper.java │ │ │ │ ├── MongoJsonSchemaMapper.java │ │ │ │ ├── MongoTypeMapper.java │ │ │ │ ├── MongoValueConverter.java │ │ │ │ ├── MongoWriter.java │ │ │ │ ├── NoOpDbRefResolver.java │ │ │ │ ├── ObjectPath.java │ │ │ │ ├── QueryMapper.java │ │ │ │ ├── ReferenceLoader.java │ │ │ │ ├── ReferenceLookupDelegate.java │ │ │ │ ├── ReferenceResolver.java │ │ │ │ ├── UpdateMapper.java │ │ │ │ ├── ValueResolver.java │ │ │ │ ├── encryption │ │ │ │ │ ├── EncryptingConverter.java │ │ │ │ │ ├── ExplicitEncryptionContext.java │ │ │ │ │ ├── MongoEncryptionConverter.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── encryption │ │ │ │ ├── Encryption.java │ │ │ │ ├── EncryptionContext.java │ │ │ │ ├── EncryptionKey.java │ │ │ │ ├── EncryptionKeyResolver.java │ │ │ │ ├── EncryptionOptions.java │ │ │ │ ├── KeyAltName.java │ │ │ │ ├── KeyId.java │ │ │ │ ├── MongoClientEncryption.java │ │ │ │ └── package-info.java │ │ │ ├── geo │ │ │ │ ├── GeoJson.java │ │ │ │ ├── GeoJsonGeometryCollection.java │ │ │ │ ├── GeoJsonLineString.java │ │ │ │ ├── GeoJsonModule.java │ │ │ │ ├── GeoJsonMultiLineString.java │ │ │ │ ├── GeoJsonMultiPoint.java │ │ │ │ ├── GeoJsonMultiPolygon.java │ │ │ │ ├── GeoJsonPoint.java │ │ │ │ ├── GeoJsonPolygon.java │ │ │ │ ├── GeoJsonSerializersModule.java │ │ │ │ ├── Sphere.java │ │ │ │ └── package-info.java │ │ │ ├── index │ │ │ │ ├── CompoundIndex.java │ │ │ │ ├── CompoundIndexDefinition.java │ │ │ │ ├── CompoundIndexes.java │ │ │ │ ├── DefaultSearchIndexOperations.java │ │ │ │ ├── GeoSpatialIndexType.java │ │ │ │ ├── GeoSpatialIndexed.java │ │ │ │ ├── GeospatialIndex.java │ │ │ │ ├── HashIndexed.java │ │ │ │ ├── HashedIndex.java │ │ │ │ ├── Index.java │ │ │ │ ├── IndexDefinition.java │ │ │ │ ├── IndexDirection.java │ │ │ │ ├── IndexField.java │ │ │ │ ├── IndexFilter.java │ │ │ │ ├── IndexInfo.java │ │ │ │ ├── IndexOperations.java │ │ │ │ ├── IndexOperationsAdapter.java │ │ │ │ ├── IndexOperationsProvider.java │ │ │ │ ├── IndexOptions.java │ │ │ │ ├── IndexPredicate.java │ │ │ │ ├── IndexResolver.java │ │ │ │ ├── Indexed.java │ │ │ │ ├── MongoMappingEventPublisher.java │ │ │ │ ├── MongoPersistentEntityIndexCreator.java │ │ │ │ ├── MongoPersistentEntityIndexResolver.java │ │ │ │ ├── PartialIndexFilter.java │ │ │ │ ├── ReactiveIndexOperations.java │ │ │ │ ├── ReactiveIndexOperationsProvider.java │ │ │ │ ├── ReactiveMongoPersistentEntityIndexCreator.java │ │ │ │ ├── SearchIndexDefinition.java │ │ │ │ ├── SearchIndexInfo.java │ │ │ │ ├── SearchIndexOperations.java │ │ │ │ ├── SearchIndexOperationsProvider.java │ │ │ │ ├── SearchIndexStatus.java │ │ │ │ ├── TextIndexDefinition.java │ │ │ │ ├── TextIndexed.java │ │ │ │ ├── VectorIndex.java │ │ │ │ ├── WildcardIndex.java │ │ │ │ ├── WildcardIndexed.java │ │ │ │ └── package-info.java │ │ │ ├── mapping │ │ │ │ ├── BasicMongoPersistentEntity.java │ │ │ │ ├── BasicMongoPersistentProperty.java │ │ │ │ ├── CachingMongoPersistentProperty.java │ │ │ │ ├── DBRef.java │ │ │ │ ├── Document.java │ │ │ │ ├── DocumentPointer.java │ │ │ │ ├── DocumentReference.java │ │ │ │ ├── Encrypted.java │ │ │ │ ├── ExplicitEncrypted.java │ │ │ │ ├── Field.java │ │ │ │ ├── FieldName.java │ │ │ │ ├── FieldType.java │ │ │ │ ├── Language.java │ │ │ │ ├── MongoField.java │ │ │ │ ├── MongoId.java │ │ │ │ ├── MongoMappingContext.java │ │ │ │ ├── MongoPersistentEntity.java │ │ │ │ ├── MongoPersistentProperty.java │ │ │ │ ├── MongoSimpleTypes.java │ │ │ │ ├── MongoVector.java │ │ │ │ ├── PersistentPropertyTranslator.java │ │ │ │ ├── Queryable.java │ │ │ │ ├── RangeEncrypted.java │ │ │ │ ├── ShardKey.java │ │ │ │ ├── Sharded.java │ │ │ │ ├── ShardingStrategy.java │ │ │ │ ├── TextScore.java │ │ │ │ ├── TimeSeries.java │ │ │ │ ├── UnwrapEntityContext.java │ │ │ │ ├── Unwrapped.java │ │ │ │ ├── UnwrappedMongoPersistentEntity.java │ │ │ │ ├── UnwrappedMongoPersistentProperty.java │ │ │ │ ├── event │ │ │ │ │ ├── AbstractDeleteEvent.java │ │ │ │ │ ├── AbstractMongoEventListener.java │ │ │ │ │ ├── AfterConvertCallback.java │ │ │ │ │ ├── AfterConvertEvent.java │ │ │ │ │ ├── AfterDeleteEvent.java │ │ │ │ │ ├── AfterLoadEvent.java │ │ │ │ │ ├── AfterSaveCallback.java │ │ │ │ │ ├── AfterSaveEvent.java │ │ │ │ │ ├── AuditingEntityCallback.java │ │ │ │ │ ├── BeanValidationDelegate.java │ │ │ │ │ ├── BeforeConvertCallback.java │ │ │ │ │ ├── BeforeConvertEvent.java │ │ │ │ │ ├── BeforeDeleteEvent.java │ │ │ │ │ ├── BeforeSaveCallback.java │ │ │ │ │ ├── BeforeSaveEvent.java │ │ │ │ │ ├── LoggingEventListener.java │ │ │ │ │ ├── MongoMappingEvent.java │ │ │ │ │ ├── ReactiveAfterConvertCallback.java │ │ │ │ │ ├── ReactiveAfterSaveCallback.java │ │ │ │ │ ├── ReactiveAuditingEntityCallback.java │ │ │ │ │ ├── ReactiveBeforeConvertCallback.java │ │ │ │ │ ├── ReactiveBeforeSaveCallback.java │ │ │ │ │ ├── ReactiveValidatingEntityCallback.java │ │ │ │ │ ├── ValidatingEntityCallback.java │ │ │ │ │ ├── ValidatingMongoEventListener.java │ │ │ │ │ └── package-info.java │ │ │ │ └── package-info.java │ │ │ ├── mapreduce │ │ │ │ ├── MapReduceCounts.java │ │ │ │ ├── MapReduceOptions.java │ │ │ │ ├── MapReduceResults.java │ │ │ │ ├── MapReduceTiming.java │ │ │ │ └── package-info.java │ │ │ ├── messaging │ │ │ │ ├── Cancelable.java │ │ │ │ ├── ChangeStreamRequest.java │ │ │ │ ├── ChangeStreamTask.java │ │ │ │ ├── CursorReadingTask.java │ │ │ │ ├── DefaultMessageListenerContainer.java │ │ │ │ ├── LazyMappingDelegatingMessage.java │ │ │ │ ├── Message.java │ │ │ │ ├── MessageListener.java │ │ │ │ ├── MessageListenerContainer.java │ │ │ │ ├── SimpleMessage.java │ │ │ │ ├── Subscription.java │ │ │ │ ├── SubscriptionRequest.java │ │ │ │ ├── TailableCursorRequest.java │ │ │ │ ├── TailableCursorTask.java │ │ │ │ ├── Task.java │ │ │ │ ├── TaskFactory.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ │ ├── BasicQuery.java │ │ │ │ ├── BasicUpdate.java │ │ │ │ ├── Collation.java │ │ │ │ ├── Criteria.java │ │ │ │ ├── CriteriaDefinition.java │ │ │ │ ├── Field.java │ │ │ │ ├── GeoCommand.java │ │ │ │ ├── Meta.java │ │ │ │ ├── MetricConversion.java │ │ │ │ ├── MongoRegexCreator.java │ │ │ │ ├── NearQuery.java │ │ │ │ ├── Query.java │ │ │ │ ├── SerializationUtils.java │ │ │ │ ├── Term.java │ │ │ │ ├── TextCriteria.java │ │ │ │ ├── TextQuery.java │ │ │ │ ├── UntypedExampleMatcher.java │ │ │ │ ├── Update.java │ │ │ │ ├── UpdateDefinition.java │ │ │ │ └── package-info.java │ │ │ ├── schema │ │ │ │ ├── DefaultMongoJsonSchema.java │ │ │ │ ├── DocumentJsonSchema.java │ │ │ │ ├── IdentifiableJsonSchemaProperty.java │ │ │ │ ├── JsonSchemaObject.java │ │ │ │ ├── JsonSchemaProperty.java │ │ │ │ ├── MergedJsonSchema.java │ │ │ │ ├── MergedJsonSchemaProperty.java │ │ │ │ ├── MongoJsonSchema.java │ │ │ │ ├── QueryCharacteristic.java │ │ │ │ ├── QueryCharacteristics.java │ │ │ │ ├── TypeUnifyingMergeFunction.java │ │ │ │ ├── TypedJsonSchemaObject.java │ │ │ │ ├── UntypedJsonSchemaObject.java │ │ │ │ └── package-info.java │ │ │ ├── script │ │ │ │ ├── ExecutableMongoScript.java │ │ │ │ ├── NamedMongoScript.java │ │ │ │ └── package-info.java │ │ │ ├── spel │ │ │ │ ├── ExpressionNode.java │ │ │ │ ├── ExpressionTransformationContextSupport.java │ │ │ │ ├── ExpressionTransformer.java │ │ │ │ ├── LiteralNode.java │ │ │ │ ├── MethodReferenceNode.java │ │ │ │ ├── NotOperatorNode.java │ │ │ │ ├── OperatorNode.java │ │ │ │ └── package-info.java │ │ │ ├── timeseries │ │ │ │ ├── Granularity.java │ │ │ │ └── GranularityDefinition.java │ │ │ └── validation │ │ │ │ ├── CriteriaValidator.java │ │ │ │ ├── DocumentValidator.java │ │ │ │ ├── JsonSchemaValidator.java │ │ │ │ ├── Validator.java │ │ │ │ └── package-info.java │ │ │ ├── gridfs │ │ │ ├── AntPath.java │ │ │ ├── GridFsCriteria.java │ │ │ ├── GridFsObject.java │ │ │ ├── GridFsOperations.java │ │ │ ├── GridFsOperationsSupport.java │ │ │ ├── GridFsResource.java │ │ │ ├── GridFsTemplate.java │ │ │ ├── GridFsUpload.java │ │ │ ├── ReactiveGridFsOperations.java │ │ │ ├── ReactiveGridFsResource.java │ │ │ ├── ReactiveGridFsTemplate.java │ │ │ ├── ReactiveGridFsUpload.java │ │ │ └── package-info.java │ │ │ ├── observability │ │ │ ├── ContextProviderFactory.java │ │ │ ├── DefaultMongoHandlerObservationConvention.java │ │ │ ├── MapRequestContext.java │ │ │ ├── MongoHandlerContext.java │ │ │ ├── MongoHandlerObservationConvention.java │ │ │ ├── MongoObservation.java │ │ │ ├── MongoObservationCommandListener.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── repository │ │ │ ├── Aggregation.java │ │ │ ├── CountQuery.java │ │ │ ├── DeleteQuery.java │ │ │ ├── ExistsQuery.java │ │ │ ├── Hint.java │ │ │ ├── Meta.java │ │ │ ├── MongoRepository.java │ │ │ ├── Near.java │ │ │ ├── Query.java │ │ │ ├── ReactiveMongoRepository.java │ │ │ ├── ReadPreference.java │ │ │ ├── Tailable.java │ │ │ ├── Update.java │ │ │ ├── VectorSearch.java │ │ │ ├── aot │ │ │ │ ├── AggregationInteraction.java │ │ │ │ ├── AggregationUpdateInteraction.java │ │ │ │ ├── AotMongoRepositoryPostProcessor.java │ │ │ │ ├── AotQueryCreator.java │ │ │ │ ├── MongoAotRepositoryFragmentSupport.java │ │ │ │ ├── MongoCodeBlocks.java │ │ │ │ ├── MongoInteraction.java │ │ │ │ ├── MongoRepositoryContributor.java │ │ │ │ ├── QueryInteraction.java │ │ │ │ ├── RepositoryRuntimeHints.java │ │ │ │ ├── StringAggregation.java │ │ │ │ ├── StringQuery.java │ │ │ │ ├── StringUpdate.java │ │ │ │ ├── UpdateInteraction.java │ │ │ │ └── package-info.java │ │ │ ├── cdi │ │ │ │ ├── MongoRepositoryBean.java │ │ │ │ ├── MongoRepositoryExtension.java │ │ │ │ └── package-info.java │ │ │ ├── config │ │ │ │ ├── EnableMongoRepositories.java │ │ │ │ ├── EnableReactiveMongoRepositories.java │ │ │ │ ├── MongoRepositoriesRegistrar.java │ │ │ │ ├── MongoRepositoryConfigNamespaceHandler.java │ │ │ │ ├── MongoRepositoryConfigurationExtension.java │ │ │ │ ├── ReactiveMongoRepositoriesRegistrar.java │ │ │ │ ├── ReactiveMongoRepositoryConfigurationExtension.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── query │ │ │ │ ├── AbstractMongoQuery.java │ │ │ │ ├── AbstractReactiveMongoQuery.java │ │ │ │ ├── AggregationUtils.java │ │ │ │ ├── BooleanUtil.java │ │ │ │ ├── CollationUtils.java │ │ │ │ ├── ConvertingParameterAccessor.java │ │ │ │ ├── MongoEntityInformation.java │ │ │ │ ├── MongoEntityMetadata.java │ │ │ │ ├── MongoParameterAccessor.java │ │ │ │ ├── MongoParameters.java │ │ │ │ ├── MongoParametersParameterAccessor.java │ │ │ │ ├── MongoQueryCreator.java │ │ │ │ ├── MongoQueryExecution.java │ │ │ │ ├── MongoQueryMethod.java │ │ │ │ ├── PartTreeMongoQuery.java │ │ │ │ ├── QueryUtils.java │ │ │ │ ├── ReactiveMongoParameterAccessor.java │ │ │ │ ├── ReactiveMongoQueryExecution.java │ │ │ │ ├── ReactiveMongoQueryMethod.java │ │ │ │ ├── ReactivePartTreeMongoQuery.java │ │ │ │ ├── ReactiveStringBasedAggregation.java │ │ │ │ ├── ReactiveStringBasedMongoQuery.java │ │ │ │ ├── ReactiveVectorSearchAggregation.java │ │ │ │ ├── SimpleMongoEntityMetadata.java │ │ │ │ ├── StringAggregationOperation.java │ │ │ │ ├── StringBasedAggregation.java │ │ │ │ ├── StringBasedMongoQuery.java │ │ │ │ ├── ValueExpressionDelegateValueExpressionEvaluator.java │ │ │ │ ├── VectorSearchAggregation.java │ │ │ │ ├── VectorSearchDelegate.java │ │ │ │ └── package-info.java │ │ │ ├── support │ │ │ │ ├── CrudMethodMetadata.java │ │ │ │ ├── CrudMethodMetadataPostProcessor.java │ │ │ │ ├── FetchableFluentQuerySupport.java │ │ │ │ ├── IndexEnsuringQueryCreationListener.java │ │ │ │ ├── MappingMongoEntityInformation.java │ │ │ │ ├── MongoAnnotationProcessor.java │ │ │ │ ├── MongoEntityInformationSupport.java │ │ │ │ ├── MongoRepositoryFactory.java │ │ │ │ ├── MongoRepositoryFactoryBean.java │ │ │ │ ├── MongoRepositoryFragmentsContributor.java │ │ │ │ ├── QuerydslContributor.java │ │ │ │ ├── QuerydslMongoPredicateExecutor.java │ │ │ │ ├── QuerydslPredicateExecutorSupport.java │ │ │ │ ├── QuerydslRepositorySupport.java │ │ │ │ ├── ReactiveFluentQuerySupport.java │ │ │ │ ├── ReactiveMongoRepositoryFactory.java │ │ │ │ ├── ReactiveMongoRepositoryFactoryBean.java │ │ │ │ ├── ReactiveMongoRepositoryFragmentsContributor.java │ │ │ │ ├── ReactivePageableExecutionUtils.java │ │ │ │ ├── ReactiveQuerydslContributor.java │ │ │ │ ├── ReactiveQuerydslMongoPredicateExecutor.java │ │ │ │ ├── ReactiveSpringDataMongodbQuery.java │ │ │ │ ├── SimpleMongoRepository.java │ │ │ │ ├── SimpleReactiveMongoRepository.java │ │ │ │ ├── SpringDataMongodbQuery.java │ │ │ │ ├── SpringDataMongodbQuerySupport.java │ │ │ │ ├── SpringDataMongodbSerializer.java │ │ │ │ └── package-info.java │ │ │ └── util │ │ │ │ └── SliceUtils.java │ │ │ └── util │ │ │ ├── BsonUtils.java │ │ │ ├── DBObjectUtils.java │ │ │ ├── DotPath.java │ │ │ ├── DurationUtil.java │ │ │ ├── EmptyDocument.java │ │ │ ├── MongoClientVersion.java │ │ │ ├── MongoDbErrorCodes.java │ │ │ ├── RegexFlags.java │ │ │ ├── SpringJsonWriter.java │ │ │ ├── aggregation │ │ │ └── TestAggregationContext.java │ │ │ ├── encryption │ │ │ └── EncryptionUtils.java │ │ │ ├── json │ │ │ ├── DateTimeFormatter.java │ │ │ ├── EvaluationContextExpressionEvaluator.java │ │ │ ├── JsonBuffer.java │ │ │ ├── JsonScanner.java │ │ │ ├── JsonToken.java │ │ │ ├── JsonTokenType.java │ │ │ ├── ParameterBindingContext.java │ │ │ ├── ParameterBindingDocumentCodec.java │ │ │ ├── ParameterBindingJsonReader.java │ │ │ ├── ValueProvider.java │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── spel │ │ │ └── ExpressionUtils.java │ ├── kotlin │ │ └── org │ │ │ └── springframework │ │ │ └── data │ │ │ └── mongodb │ │ │ └── core │ │ │ ├── BulkOperationsExtensions.kt │ │ │ ├── ExecutableAggregationOperationExtensions.kt │ │ │ ├── ExecutableFindOperationExtensions.kt │ │ │ ├── ExecutableInsertOperationExtensions.kt │ │ │ ├── ExecutableMapReduceOperationExtensions.kt │ │ │ ├── ExecutableRemoveOperationExtensions.kt │ │ │ ├── ExecutableUpdateOperationExtensions.kt │ │ │ ├── MongoOperationsExtensions.kt │ │ │ ├── ReactiveAggregationOperationExtensions.kt │ │ │ ├── ReactiveChangeStreamOperationExtensions.kt │ │ │ ├── ReactiveFindOperationExtensions.kt │ │ │ ├── ReactiveInsertOperationExtensions.kt │ │ │ ├── ReactiveMapReduceOperationExtensions.kt │ │ │ ├── ReactiveMongoOperationsExtensions.kt │ │ │ ├── ReactiveRemoveOperationExtensions.kt │ │ │ ├── ReactiveUpdateOperationExtensions.kt │ │ │ └── query │ │ │ ├── CriteriaExtensions.kt │ │ │ ├── TypedCriteriaExtensions.kt │ │ │ └── TypedUpdateExtensions.kt │ └── resources │ │ ├── META-INF │ │ ├── services │ │ │ └── jakarta.enterprise.inject.spi.Extension │ │ ├── spring.factories │ │ ├── spring.handlers │ │ ├── spring.schemas │ │ ├── spring.tooling │ │ └── spring │ │ │ └── aot.factories │ │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ └── config │ │ ├── spring-mongo-1.0.xsd │ │ ├── spring-mongo-1.1.xsd │ │ ├── spring-mongo-1.10.2.xsd │ │ ├── spring-mongo-1.10.xsd │ │ ├── spring-mongo-1.2.xsd │ │ ├── spring-mongo-1.3.xsd │ │ ├── spring-mongo-1.4.xsd │ │ ├── spring-mongo-1.5.xsd │ │ ├── spring-mongo-1.7.xsd │ │ ├── spring-mongo-1.8.xsd │ │ ├── spring-mongo-2.0.xsd │ │ ├── spring-mongo-2.2.xsd │ │ ├── spring-mongo-3.0.xsd │ │ ├── spring-mongo-3.3.xsd │ │ ├── spring-mongo-4.0.xsd │ │ └── spring-mongo-5.0.xsd │ └── test │ ├── java │ ├── ConfigClassInDefaultPackage.java │ ├── ConfigClassInDefaultPackageUnitTests.java │ ├── example │ │ ├── aot │ │ │ ├── User.java │ │ │ ├── UserProjection.java │ │ │ └── UserRepository.java │ │ ├── first │ │ │ └── First.java │ │ └── second │ │ │ └── Second.java │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ ├── CapturingTransactionOptionsResolver.java │ │ ├── DefaultMongoTransactionOptionsResolverUnitTests.java │ │ ├── DependencyTests.java │ │ ├── MongoDatabaseUtilsUnitTests.java │ │ ├── MongoTransactionManagerUnitTests.java │ │ ├── MongoTransactionOptionsUnitTests.java │ │ ├── ReactiveMongoDatabaseUtilsUnitTests.java │ │ ├── ReactiveMongoTransactionManagerUnitTests.java │ │ ├── ReactiveTransactionIntegrationTests.java │ │ ├── ReactiveTransactionOptionsTestService.java │ │ ├── SessionAwareMethodInterceptorUnitTests.java │ │ ├── SpringDataMongoDBTests.java │ │ ├── aot │ │ ├── LazyLoadingProxyAotProcessorUnitTests.java │ │ ├── MongoRuntimeHintsUnitTests.java │ │ └── generated │ │ │ └── DemoRepo.java │ │ ├── classloading │ │ └── HidingClassLoader.java │ │ ├── config │ │ ├── AbstractIntegrationTests.java │ │ ├── AbstractMongoConfigurationUnitTests.java │ │ ├── AbstractReactiveMongoConfigurationIntegrationTests.java │ │ ├── AbstractReactiveMongoConfigurationUnitTests.java │ │ ├── AuditingIntegrationTests.java │ │ ├── AuditingViaJavaConfigRepositoriesTests.java │ │ ├── CustomMongoTypeMapper.java │ │ ├── GeoJsonConfigurationIntegrationTests.java │ │ ├── MappingMongoConverterParserIntegrationTests.java │ │ ├── MappingMongoConverterParserValidationIntegrationTests.java │ │ ├── MongoAuditingRegistrarUnitTests.java │ │ ├── MongoClientNamespaceTests.java │ │ ├── MongoClientParserIntegrationTests.java │ │ ├── MongoCredentialPropertyEditorUnitTests.java │ │ ├── MongoDbFactoryNoDatabaseRunningTests.java │ │ ├── MongoDbFactoryParserIntegrationTests.java │ │ ├── MongoNamespaceReplicaSetTests.java │ │ ├── MongoNamespaceTests.java │ │ ├── MongoParserIntegrationTests.java │ │ ├── ReactiveAuditingTests.java │ │ ├── ReadPreferencePropertyEditorUnitTests.java │ │ ├── ServerAddressPropertyEditorUnitTests.java │ │ ├── StringToWriteConcernConverterUnitTests.java │ │ └── WriteConcernPropertyEditorUnitTests.java │ │ ├── core │ │ ├── AuditablePerson.java │ │ ├── BaseDoc.java │ │ ├── ChangeStreamOptionsUnitTests.java │ │ ├── ClientSessionTests.java │ │ ├── CloseableIterableCursorAdapterUnitTests.java │ │ ├── CollationUnitTests.java │ │ ├── CollectionOptionsUnitTests.java │ │ ├── CountQueryUnitTests.java │ │ ├── DefaultBulkOperationsIntegrationTests.java │ │ ├── DefaultBulkOperationsUnitTests.java │ │ ├── DefaultIndexOperationsIntegrationTests.java │ │ ├── DefaultIndexOperationsUnitTests.java │ │ ├── DefaultReactiveBulkOperationsTests.java │ │ ├── DefaultReactiveBulkOperationsUnitTests.java │ │ ├── DefaultReactiveIndexOperationsTests.java │ │ ├── DefaultReactiveIndexOperationsUnitTests.java │ │ ├── DefaultScriptOperationsTests.java │ │ ├── DefaultScriptOperationsUnitTests.java │ │ ├── DocumentTestUtils.java │ │ ├── EntityOperationsUnitTests.java │ │ ├── ExecutableAggregationOperationSupportUnitTests.java │ │ ├── ExecutableFindOperationSupportTests.java │ │ ├── ExecutableInsertOperationSupportUnitTests.java │ │ ├── ExecutableMapReduceOperationSupportUnitTests.java │ │ ├── ExecutableRemoveOperationSupportTests.java │ │ ├── ExecutableUpdateOperationSupportTests.java │ │ ├── Friend.java │ │ ├── GeoCommandStatisticsUnitTests.java │ │ ├── JsonSchemaQueryTests.java │ │ ├── MappingMongoJsonSchemaCreatorUnitTests.java │ │ ├── MongoAdminIntegrationTests.java │ │ ├── MongoClientFactoryBeanUnitTests.java │ │ ├── MongoClientSettingsFactoryBeanIntegrationTests.java │ │ ├── MongoClientSettingsFactoryBeanUnitTests.java │ │ ├── MongoEncryptionSettingsFactoryBeanTests.java │ │ ├── MongoExceptionTranslatorUnitTests.java │ │ ├── MongoOperationsUnitTests.java │ │ ├── MongoServerApiFactoryBeanTests.java │ │ ├── MongoTemplateCollationTests.java │ │ ├── MongoTemplateDbRefTests.java │ │ ├── MongoTemplateDocumentReferenceTests.java │ │ ├── MongoTemplateFieldProjectionTests.java │ │ ├── MongoTemplateMappingTests.java │ │ ├── MongoTemplateReplaceTests.java │ │ ├── MongoTemplateScrollTests.java │ │ ├── MongoTemplateTests.java │ │ ├── MongoTemplateTransactionTests.java │ │ ├── MongoTemplateUnitTests.java │ │ ├── MongoTemplateUnwrappedTests.java │ │ ├── MongoTemplateUpdateTests.java │ │ ├── MongoTemplateValidationTests.java │ │ ├── MongoTemplateViewTests.java │ │ ├── NoExplicitIdTests.java │ │ ├── Person.java │ │ ├── PersonExample.java │ │ ├── PersonExampleAppConfig.java │ │ ├── PersonReadConverter.java │ │ ├── PersonWithAList.java │ │ ├── PersonWithIdPropertyOfPrimitiveInt.java │ │ ├── PersonWithIdPropertyOfPrimitiveLong.java │ │ ├── PersonWithIdPropertyOfTypeBigInteger.java │ │ ├── PersonWithIdPropertyOfTypeInteger.java │ │ ├── PersonWithIdPropertyOfTypeLong.java │ │ ├── PersonWithIdPropertyOfTypeObjectId.java │ │ ├── PersonWithIdPropertyOfTypeString.java │ │ ├── PersonWithIdPropertyOfTypeUUID.java │ │ ├── PersonWithVersionPropertyOfTypeInteger.java │ │ ├── PersonWithVersionPropertyOfTypeLong.java │ │ ├── PersonWith_idPropertyOfTypeObjectId.java │ │ ├── PersonWith_idPropertyOfTypeString.java │ │ ├── PersonWriteConverter.java │ │ ├── Portfolio.java │ │ ├── QueryByExampleTests.java │ │ ├── QueryCursorPreparerUnitTests.java │ │ ├── QueryOperationsUnitTests.java │ │ ├── QueryResultConverterUnitTests.java │ │ ├── ReactiveAggregationOperationSupportUnitTests.java │ │ ├── ReactiveChangeStreamOperationSupportTests.java │ │ ├── ReactiveChangeStreamOperationSupportUnitTests.java │ │ ├── ReactiveClientSessionTests.java │ │ ├── ReactiveFindOperationSupportTests.java │ │ ├── ReactiveInsertOperationSupportUnitTests.java │ │ ├── ReactiveMapReduceOperationSupportUnitTests.java │ │ ├── ReactiveMongoTemplateCollationTests.java │ │ ├── ReactiveMongoTemplateExecuteTests.java │ │ ├── ReactiveMongoTemplateIndexTests.java │ │ ├── ReactiveMongoTemplateReplaceTests.java │ │ ├── ReactiveMongoTemplateScrollTests.java │ │ ├── ReactiveMongoTemplateTests.java │ │ ├── ReactiveMongoTemplateTransactionTests.java │ │ ├── ReactiveMongoTemplateUnitTests.java │ │ ├── ReactiveMongoTemplateUpdateTests.java │ │ ├── ReactiveMongoTemplateViewTests.java │ │ ├── ReactiveRemoveOperationSupportTests.java │ │ ├── ReactiveSessionBoundMongoTemplateUnitTests.java │ │ ├── ReactiveUpdateOperationSupportTests.java │ │ ├── ScrollUtilsUnitTests.java │ │ ├── SerializationUtilsUnitTests.java │ │ ├── SessionBoundMongoTemplateTests.java │ │ ├── SessionBoundMongoTemplateUnitTests.java │ │ ├── ShardedEntityWithDefaultShardKey.java │ │ ├── ShardedEntityWithNonDefaultImmutableShardKey.java │ │ ├── ShardedEntityWithNonDefaultShardKey.java │ │ ├── ShardedVersionedEntityWithNonDefaultShardKey.java │ │ ├── SimpleMongoClientDatabaseFactoryUnitTests.java │ │ ├── SimpleReactiveMongoDatabaseFactoryUnitTests.java │ │ ├── SpecialDoc.java │ │ ├── TestEntities.java │ │ ├── TestMongoConfiguration.java │ │ ├── Trade.java │ │ ├── TradeBatch.java │ │ ├── TransactionOptionsTestService.java │ │ ├── UpdateOperationsUnitTests.java │ │ ├── User.java │ │ ├── Venue.java │ │ ├── VerySpecialDoc.java │ │ ├── aggregation │ │ │ ├── AccumulatorOperatorsUnitTests.java │ │ │ ├── AddFieldsOperationUnitTests.java │ │ │ ├── AggregationOperationRendererUnitTests.java │ │ │ ├── AggregationOptionsTests.java │ │ │ ├── AggregationTests.java │ │ │ ├── AggregationUnitTests.java │ │ │ ├── AggregationUpdateUnitTests.java │ │ │ ├── AggregationVariableUnitTests.java │ │ │ ├── ArithmeticOperatorsUnitTests.java │ │ │ ├── ArrayOperatorsUnitTests.java │ │ │ ├── BasicAggregationOperationUnitTests.java │ │ │ ├── BucketAutoOperationUnitTests.java │ │ │ ├── BucketOperationUnitTests.java │ │ │ ├── City.java │ │ │ ├── CondExpressionUnitTests.java │ │ │ ├── ConditionalOperatorsUnitTests.java │ │ │ ├── ConvertOperatorsUnitTests.java │ │ │ ├── CountOperationUnitTests.java │ │ │ ├── Data.java │ │ │ ├── DataItem.java │ │ │ ├── DateOperatorsUnitTests.java │ │ │ ├── DensifyOperationUnitTests.java │ │ │ ├── DocumentOperatorsUnitTests.java │ │ │ ├── EvaluationOperatorsUnitTests.java │ │ │ ├── ExposedFieldsUnitTests.java │ │ │ ├── FacetOperationUnitTests.java │ │ │ ├── FieldsUnitTests.java │ │ │ ├── FilterExpressionUnitTests.java │ │ │ ├── GeoNearOperationUnitTests.java │ │ │ ├── GraphLookupOperationUnitTests.java │ │ │ ├── GroupOperationUnitTests.java │ │ │ ├── Invoice.java │ │ │ ├── LikeStats.java │ │ │ ├── LineItem.java │ │ │ ├── LookupOperationUnitTests.java │ │ │ ├── MatchOperationUnitTests.java │ │ │ ├── MergeOperationUnitTests.java │ │ │ ├── MeterData.java │ │ │ ├── ObjectOperatorsUnitTests.java │ │ │ ├── Order.java │ │ │ ├── OutOperationUnitTest.java │ │ │ ├── Product.java │ │ │ ├── ProjectionOperationUnitTests.java │ │ │ ├── ReactiveAggregationTests.java │ │ │ ├── ReactiveAggregationUnitTests.java │ │ │ ├── RedactOperationUnitTests.java │ │ │ ├── ReplaceRootOperationUnitTests.java │ │ │ ├── ReplaceWithOperationUnitTests.java │ │ │ ├── SampleOperationUnitTests.java │ │ │ ├── ScriptOperatorsUnitTests.java │ │ │ ├── SelectionOperatorUnitTests.java │ │ │ ├── SetOperationUnitTests.java │ │ │ ├── SetWindowFieldsOperationTests.java │ │ │ ├── SetWindowFieldsOperationUnitTests.java │ │ │ ├── SkipOperationUnitTests.java │ │ │ ├── SortByCountOperationUnitTests.java │ │ │ ├── SortOperationUnitTests.java │ │ │ ├── SpelExpressionTransformerIntegrationTests.java │ │ │ ├── SpelExpressionTransformerUnitTests.java │ │ │ ├── StateStats.java │ │ │ ├── StringOperatorsUnitTests.java │ │ │ ├── TagCount.java │ │ │ ├── TypeBasedAggregationOperationContextUnitTests.java │ │ │ ├── UnionWithOperationUnitTests.java │ │ │ ├── UnsetOperationUnitTests.java │ │ │ ├── UnwindOperationUnitTests.java │ │ │ ├── UserWithLikes.java │ │ │ ├── VectorSearchOperationUnitTests.java │ │ │ ├── VectorSearchTests.java │ │ │ ├── ZipInfo.java │ │ │ └── ZipInfoStats.java │ │ ├── auditing │ │ │ ├── MongoTemplateAuditingTests.java │ │ │ └── ReactiveMongoTemplateAuditingTests.java │ │ ├── convert │ │ │ ├── AbstractMongoConverterUnitTests.java │ │ │ ├── CustomConvertersUnitTests.java │ │ │ ├── DataMongo273Tests.java │ │ │ ├── DbRefMappingMongoConverterUnitTests.java │ │ │ ├── DefaultDbRefResolverUnitTests.java │ │ │ ├── DefaultMongoTypeMapperUnitTests.java │ │ │ ├── DocumentAccessorUnitTests.java │ │ │ ├── DocumentPointerFactoryUnitTests.java │ │ │ ├── GeoConvertersUnitTests.java │ │ │ ├── GeoJsonConverterUnitTests.java │ │ │ ├── LazyLoadingInterceptorUnitTests.java │ │ │ ├── LazyLoadingTestUtils.java │ │ │ ├── MappingMongoConverterTests.java │ │ │ ├── MappingMongoConverterUnitTests.java │ │ │ ├── MongoConvertersIntegrationTests.java │ │ │ ├── MongoConvertersUnitTests.java │ │ │ ├── MongoCustomConversionsUnitTests.java │ │ │ ├── MongoExampleMapperUnitTests.java │ │ │ ├── MongoJsonSchemaMapperUnitTests.java │ │ │ ├── NamedMongoScriptConvertsUnitTests.java │ │ │ ├── NumberToNumberConverterFactoryUnitTests.java │ │ │ ├── ObjectPathUnitTests.java │ │ │ ├── QueryMapperUnitTests.java │ │ │ ├── ReferenceLookupDelegateUnitTests.java │ │ │ ├── ReversingValueConverter.java │ │ │ ├── TermToStringConverterUnitTests.java │ │ │ └── UpdateMapperUnitTests.java │ │ ├── encryption │ │ │ ├── AbstractEncryptionTestBase.java │ │ │ ├── BypassAutoEncryptionTest.java │ │ │ ├── EncryptionKeyResolverUnitTests.java │ │ │ ├── EncryptionKeyUnitTests.java │ │ │ ├── EncryptionTests.java │ │ │ ├── MongoClientEncryptionUnitTests.java │ │ │ ├── MongoEncryptionConverterUnitTests.java │ │ │ ├── MongoQueryableEncryptionCollectionCreationTests.java │ │ │ └── RangeEncryptionTests.java │ │ ├── geo │ │ │ ├── AbstractGeoSpatialTests.java │ │ │ ├── GeoJsonModuleUnitTests.java │ │ │ ├── GeoJsonSerializersUnitTests.java │ │ │ ├── GeoJsonTests.java │ │ │ ├── GeoSpatial2DSphereTests.java │ │ │ ├── GeoSpatial2DTests.java │ │ │ └── GeoSpatialIndexTests.java │ │ ├── index │ │ │ ├── IndexFieldUnitTests.java │ │ │ ├── IndexInfoUnitTests.java │ │ │ ├── IndexOptionsUnitTests.java │ │ │ ├── IndexingIntegrationTests.java │ │ │ ├── MongoPersistentEntityIndexCreatorIntegrationTests.java │ │ │ ├── MongoPersistentEntityIndexCreatorUnitTests.java │ │ │ ├── MongoPersistentEntityIndexResolverUnitTests.java │ │ │ ├── PathUnitTests.java │ │ │ ├── ReactiveMongoPersistentEntityIndexCreatorUnitTests.java │ │ │ ├── SampleEntity.java │ │ │ ├── SearchIndexInfoUnitTests.java │ │ │ ├── TextIndexTests.java │ │ │ └── VectorIndexIntegrationTests.java │ │ ├── mapping │ │ │ ├── Account.java │ │ │ ├── AccountPojo.java │ │ │ ├── Address.java │ │ │ ├── BasePerson.java │ │ │ ├── BasicMongoPersistentEntityUnitTests.java │ │ │ ├── BasicMongoPersistentPropertyUnitTests.java │ │ │ ├── CustomCollectionWithIndex.java │ │ │ ├── DetectedCollectionWithIndex.java │ │ │ ├── GeneratedId.java │ │ │ ├── GenericMappingTests.java │ │ │ ├── GeoIndexedAppConfig.java │ │ │ ├── GeoIndexedTests.java │ │ │ ├── GeoLocation.java │ │ │ ├── Location.java │ │ │ ├── MappingTests.java │ │ │ ├── MongoMappingContextUnitTests.java │ │ │ ├── MongoPersistentPropertyComparatorUnitTests.java │ │ │ ├── MongoVectorUnitTests.java │ │ │ ├── Person.java │ │ │ ├── PersonCustomCollection1.java │ │ │ ├── PersonCustomCollection2.java │ │ │ ├── PersonCustomIdName.java │ │ │ ├── PersonMapProperty.java │ │ │ ├── PersonMultiCollection.java │ │ │ ├── PersonMultiDimArrays.java │ │ │ ├── PersonNullProperties.java │ │ │ ├── PersonPojoIntId.java │ │ │ ├── PersonPojoLongId.java │ │ │ ├── PersonPojoStringId.java │ │ │ ├── PersonSimpleList.java │ │ │ ├── PersonWithDbRef.java │ │ │ ├── PersonWithLongDBRef.java │ │ │ ├── PersonWithObjectId.java │ │ │ ├── PrimitiveId.java │ │ │ └── event │ │ │ │ ├── AbstractMongoEventListenerUnitTests.java │ │ │ │ ├── AfterSaveListener.java │ │ │ │ ├── ApplicationContextEventTests.java │ │ │ │ ├── ApplicationContextEventTestsAppConfig.java │ │ │ │ ├── AuditingEntityCallbackUnitTests.java │ │ │ │ ├── LoggingEventListenerTests.java │ │ │ │ ├── PersonBeforeSaveListener.java │ │ │ │ ├── ReactiveValidatingEntityCallbackUnitTests.java │ │ │ │ ├── SimpleMappingEventListener.java │ │ │ │ ├── User.java │ │ │ │ ├── ValidatingEntityCallbackUnitTests.java │ │ │ │ └── ValidatingMongoEventListenerTests.java │ │ ├── mapreduce │ │ │ ├── ContentAndVersion.java │ │ │ ├── MapReduceCountsUnitTests.java │ │ │ ├── MapReduceOptionsTests.java │ │ │ ├── MapReduceResultsUnitTests.java │ │ │ ├── MapReduceTests.java │ │ │ ├── NumberAndVersion.java │ │ │ ├── ReactiveMapReduceTests.java │ │ │ ├── ValueObject.java │ │ │ └── XObject.java │ │ ├── messaging │ │ │ ├── ChangeStreamTaskUnitTests.java │ │ │ ├── ChangeStreamTests.java │ │ │ ├── CursorReadingTaskUnitTests.java │ │ │ ├── DefaultMessageListenerContainerTests.java │ │ │ ├── DefaultMessageListenerContainerUnitTests.java │ │ │ ├── SubscriptionUtils.java │ │ │ ├── TailableCursorRequestUnitTests.java │ │ │ ├── TailableCursorTests.java │ │ │ └── TaskFactoryUnitTests.java │ │ ├── query │ │ │ ├── BasicQueryUnitTests.java │ │ │ ├── BasicUpdateUnitTests.java │ │ │ ├── CriteriaTests.java │ │ │ ├── CriteriaUnitTests.java │ │ │ ├── FieldUnitTests.java │ │ │ ├── IndexUnitTests.java │ │ │ ├── MetricConversionUnitTests.java │ │ │ ├── MongoRegexCreatorUnitTests.java │ │ │ ├── NearQueryUnitTests.java │ │ │ ├── QueryTests.java │ │ │ ├── SortTests.java │ │ │ ├── TextCriteriaUnitTests.java │ │ │ ├── TextQueryTests.java │ │ │ ├── TextQueryUnitTests.java │ │ │ ├── UntypedExampleMatcherUnitTests.java │ │ │ └── UpdateTests.java │ │ ├── schema │ │ │ ├── JsonSchemaObjectUnitTests.java │ │ │ ├── JsonSchemaPropertyUnitTests.java │ │ │ ├── MongoJsonSchemaTests.java │ │ │ ├── MongoJsonSchemaUnitTests.java │ │ │ ├── ReactiveMongoJsonSchemaTests.java │ │ │ └── TypeUnifyingMergeFunctionUnitTests.java │ │ ├── script │ │ │ ├── ExecutableMongoScriptUnitTests.java │ │ │ └── NamedMongoScriptUnitTests.java │ │ ├── spel │ │ │ └── ExpressionNodeUnitTests.java │ │ └── validation │ │ │ └── CriteriaValidatorUnitTests.java │ │ ├── example │ │ ├── MongoApplication.java │ │ ├── Person.java │ │ └── ReactiveMongoApplication.java │ │ ├── gridfs │ │ ├── AntPathUnitTests.java │ │ ├── GridFsResourceUnitTests.java │ │ ├── GridFsTemplateIntegrationTests.java │ │ ├── GridFsTemplateUnitTests.java │ │ ├── ReactiveGridFsResourceUnitTests.java │ │ ├── ReactiveGridFsTemplateTests.java │ │ └── ReactiveGridFsTemplateUnitTests.java │ │ ├── observability │ │ ├── ImperativeIntegrationTests.java │ │ ├── MongoObservationCommandListenerTests.java │ │ ├── ReactiveIntegrationTests.java │ │ └── TestConfig.java │ │ ├── performance │ │ ├── PerformanceTests.java │ │ └── ReactivePerformanceTests.java │ │ ├── repository │ │ ├── AbstractPersonRepositoryIntegrationTests.java │ │ ├── Address.java │ │ ├── ComplexIdRepositoryIntegrationTests.java │ │ ├── Contact.java │ │ ├── ContactRepository.java │ │ ├── ContactRepositoryIntegrationTests.java │ │ ├── ConvertingReactiveMongoRepositoryTests.java │ │ ├── Credentials.java │ │ ├── MongoRepositoryTextSearchIntegrationTests.java │ │ ├── MyId.java │ │ ├── Person.java │ │ ├── PersonAggregate.java │ │ ├── PersonExcerpt.java │ │ ├── PersonRepository.java │ │ ├── PersonRepositoryIntegrationTests.java │ │ ├── PersonRepositoryLazyLoadingIntegrationTests.java │ │ ├── PersonRepositoryTransactionalTests.java │ │ ├── PersonSummary.java │ │ ├── PersonSummaryDto.java │ │ ├── PersonSummaryWithOptional.java │ │ ├── ReactiveMongoRepositoryTests.java │ │ ├── ReactivePersonRepository.java │ │ ├── ReactiveVectorSearchTests.java │ │ ├── RedeclaringRepositoryMethodsRepository.java │ │ ├── RedeclaringRepositoryMethodsTests.java │ │ ├── RepositoryIndexCreationIntegrationTests.java │ │ ├── SampleEvaluationContextExtension.java │ │ ├── SimpleReactiveMongoRepositoryTests.java │ │ ├── SumAge.java │ │ ├── User.java │ │ ├── UserWithComplexId.java │ │ ├── UserWithComplexIdRepository.java │ │ ├── UsernameAndPassword.java │ │ ├── VectorSearchTests.java │ │ ├── VersionedPerson.java │ │ ├── VersionedPersonRepositoryIntegrationTests.java │ │ ├── aot │ │ │ ├── AotContributionIntegrationTests.java │ │ │ ├── AotFragmentTestConfigurationSupport.java │ │ │ ├── MongoRepositoryContributorTests.java │ │ │ ├── MongoRepositoryContributorUnitTests.java │ │ │ ├── MongoRepositoryMetadataTests.java │ │ │ ├── ReactiveAotContributionIntegrationTests.java │ │ │ ├── RepositoryRuntimeHintsUnitTests.java │ │ │ ├── StubRepositoryInformation.java │ │ │ └── TestMongoAotRepositoryContext.java │ │ ├── cdi │ │ │ ├── CdiExtensionIntegrationTests.java │ │ │ ├── CdiPersonRepository.java │ │ │ ├── MongoTemplateProducer.java │ │ │ ├── RepositoryClient.java │ │ │ ├── SamplePersonFragment.java │ │ │ ├── SamplePersonFragmentImpl.java │ │ │ └── SamplePersonRepository.java │ │ ├── config │ │ │ ├── MongoNamespaceIntegrationTests.java │ │ │ ├── MongoRepositoriesRegistrarIntegrationTests.java │ │ │ ├── MongoRepositoriesRegistrarUnitTests.java │ │ │ ├── MongoRepositoryConfigurationExtensionUnitTests.java │ │ │ ├── ReactiveMongoRepositoriesRegistrarIntegrationTests.java │ │ │ ├── ReactiveMongoRepositoriesRegistrarUnitTests.java │ │ │ ├── ReactiveMongoRepositoryConfigurationExtensionUnitTests.java │ │ │ └── lazy │ │ │ │ ├── AllowNestedMongoRepositoriesRepositoryConfigTests.java │ │ │ │ ├── ClassWithNestedRepository.java │ │ │ │ └── NestedMongoRepositoriesJavaConfigTests.java │ │ ├── custom │ │ │ ├── ComposedRepository.java │ │ │ ├── ComposedRepositoryImplementationTests.java │ │ │ ├── CustomMongoRepository.java │ │ │ ├── CustomMongoRepositoryImpl.java │ │ │ ├── CustomReactiveMongoRepository.java │ │ │ ├── CustomReactiveMongoRepositoryCustom.java │ │ │ ├── CustomReactiveMongoRepositoryImpl.java │ │ │ ├── CustomReactiveRepositoryImplementationTests.java │ │ │ ├── CustomRepositoryImplementationTests.java │ │ │ ├── RepositoryMixin.java │ │ │ └── RepositoryMixinImpl.java │ │ ├── query │ │ │ ├── AbstractMongoQueryUnitTests.java │ │ │ ├── AbstractReactiveMongoQueryUnitTests.java │ │ │ ├── ConvertingParameterAccessorUnitTests.java │ │ │ ├── MappingMongoEntityInformationUnitTests.java │ │ │ ├── MongoParametersParameterAccessorUnitTests.java │ │ │ ├── MongoParametersUnitTests.java │ │ │ ├── MongoQueryCreatorUnitTests.java │ │ │ ├── MongoQueryExecutionUnitTests.java │ │ │ ├── MongoQueryMethodUnitTests.java │ │ │ ├── PartTreeMongoQueryUnitTests.java │ │ │ ├── ReactiveMongoQueryExecutionUnitTests.java │ │ │ ├── ReactiveMongoQueryMethodUnitTests.java │ │ │ ├── ReactiveStringBasedAggregationUnitTests.java │ │ │ ├── ReactiveStringBasedMongoQueryUnitTests.java │ │ │ ├── StringBasedAggregationOperationUnitTests.java │ │ │ ├── StringBasedAggregationUnitTests.java │ │ │ ├── StringBasedMongoQueryUnitTests.java │ │ │ ├── StubParameterAccessor.java │ │ │ ├── VectorSearchAggregationUnitTests.java │ │ │ └── VectorSearchDelegateUnitTests.java │ │ ├── support │ │ │ ├── DefaultCrudMethodMetadataUnitTests.java │ │ │ ├── IndexEnsuringQueryCreationListenerUnitTests.java │ │ │ ├── MongoRepositoryFactoryBeanUnitTests.java │ │ │ ├── MongoRepositoryFactoryUnitTests.java │ │ │ ├── MongoRepositoryFragmentsContributorUnitTests.java │ │ │ ├── QuerydslMongoPredicateExecutorIntegrationTests.java │ │ │ ├── QuerydslRepositorySupportTests.java │ │ │ ├── ReactiveMongoRepositoryFactoryUnitTests.java │ │ │ ├── ReactiveMongoRepositoryFragmentsContributorUnitTests.java │ │ │ ├── ReactiveQuerydslMongoPredicateExecutorTests.java │ │ │ ├── SimpleMongoRepositoryTests.java │ │ │ ├── SimpleMongoRepositoryUnitTests.java │ │ │ ├── SimpleMongoRepositoryVersionedEntityTests.java │ │ │ ├── SimpleReactiveMongoRepositoryUnitTests.java │ │ │ ├── SimpleReactiveMongoRepositoryVersionedEntityTests.java │ │ │ └── SpringDataMongodbSerializerUnitTests.java │ │ └── util │ │ │ └── SliceUtilsUnitTests.java │ │ ├── test │ │ └── util │ │ │ ├── AfterTransactionAssertion.java │ │ │ ├── AssertErrors.java │ │ │ ├── Assertions.java │ │ │ ├── AtlasContainer.java │ │ │ ├── BasicDbListBuilder.java │ │ │ ├── ClassPathExclusions.java │ │ │ ├── ClassPathExclusionsExtension.java │ │ │ ├── CleanMongoDB.java │ │ │ ├── CleanMongoDBJunitRunListener.java │ │ │ ├── CleanMongoDBTests.java │ │ │ ├── Client.java │ │ │ ├── CollectionInfo.java │ │ │ ├── DirtiesStateExtension.java │ │ │ ├── DocumentAssert.java │ │ │ ├── EnableIfMongoServerVersion.java │ │ │ ├── EnableIfReplicaSetAvailable.java │ │ │ ├── EnableIfVectorSearchAvailable.java │ │ │ ├── ExcludeReactiveClientFromClassPath.java │ │ │ ├── ExcludeSyncClientFromClassPath.java │ │ │ ├── MappingContextConfigurer.java │ │ │ ├── MongoClientClosingTestConfiguration.java │ │ │ ├── MongoClientExtension.java │ │ │ ├── MongoConverterConfigurer.java │ │ │ ├── MongoExtensions.java │ │ │ ├── MongoServerCondition.java │ │ │ ├── MongoTemplateExtension.java │ │ │ ├── MongoTestMappingContext.java │ │ │ ├── MongoTestTemplate.java │ │ │ ├── MongoTestTemplateConfiguration.java │ │ │ ├── MongoTestUtils.java │ │ │ ├── MongoVersion.java │ │ │ ├── MongoVersionRule.java │ │ │ ├── PackageExcludingClassLoader.java │ │ │ ├── ReactiveMongoClientClosingTestConfiguration.java │ │ │ ├── ReactiveMongoTestTemplate.java │ │ │ ├── ReplSetClient.java │ │ │ ├── ReplicaSet.java │ │ │ └── Template.java │ │ └── util │ │ ├── MongoClientVersionUnitTests.java │ │ ├── SpringJsonWriterUnitTests.java │ │ └── json │ │ ├── BsonUtilsTest.java │ │ └── ParameterBindingJsonReaderUnitTests.java │ ├── kotlin │ └── org │ │ └── springframework │ │ └── data │ │ └── mongodb │ │ ├── core │ │ ├── BulkOperationExtensionsTests.kt │ │ ├── Entities.kt │ │ ├── ExecutableAggregationOperationExtensionsTests.kt │ │ ├── ExecutableFindOperationExtensionsTests.kt │ │ ├── ExecutableInsertOperationExtensionsTests.kt │ │ ├── ExecutableMapReduceOperationExtensionsTests.kt │ │ ├── ExecutableRemoveOperationExtensionsTests.kt │ │ ├── ExecutableUpdateOperationExtensionsTests.kt │ │ ├── MongoOperationsExtensionsTests.kt │ │ ├── ReactiveAggregationOperationExtensionsTests.kt │ │ ├── ReactiveChangeStreamOperationExtensionsTests.kt │ │ ├── ReactiveFindOperationExtensionsTests.kt │ │ ├── ReactiveInsertOperationExtensionsTests.kt │ │ ├── ReactiveMapReduceOperationExtensionsTests.kt │ │ ├── ReactiveMongoOperationsExtensionsTests.kt │ │ ├── ReactiveRemoveOperationExtensionsTests.kt │ │ ├── ReactiveUpdateOperationExtensionsTests.kt │ │ ├── convert │ │ │ ├── MappingMongoConverterKtUnitTests.kt │ │ │ └── SpecialTransaction.kt │ │ └── query │ │ │ ├── CriteriaExtensionsTests.kt │ │ │ ├── TypedCriteriaExtensionsTests.kt │ │ │ └── TypedUpdateExtensionsTests.kt │ │ └── repository │ │ ├── CoroutineRepositoryUnitTests.kt │ │ ├── KotlinRepositoryUnitTests.kt │ │ └── query │ │ └── ReactiveMongoQueryMethodCoroutineUnitTests.kt │ └── resources │ ├── META-INF │ └── mongo-named-queries.properties │ ├── geospatial.xml │ ├── gridfs │ ├── another-resource.xml │ ├── gridfs.xml │ └── reactive-gridfs.xml │ ├── groupReduce.js │ ├── infrastructure.xml │ ├── keyFunction.js │ ├── logback.xml │ ├── logging.properties │ ├── map.js │ ├── namespace │ ├── converter-custom-fieldnamingstrategy.xml │ ├── converter-custom-typeMapper.xml │ ├── converter-default.xml │ ├── converter-invalid.xml │ ├── converter-nested-bean-definition.xml │ ├── converter-validation-disabled.xml │ ├── converter-validation-enabled.xml │ ├── converter.xml │ ├── db-factory-bean-custom-write-concern.xml │ ├── db-factory-bean.xml │ ├── mongo-bean.xml │ ├── mongo-client-uri-and-id.xml │ ├── mongo-client-uri.xml │ ├── mongo-uri-and-id.xml │ ├── mongo-uri-no-credentials.xml │ ├── mongo-uri-write-concern-and-details.xml │ └── mongoClient-bean.xml │ ├── org │ └── springframework │ │ └── data │ │ └── mongodb │ │ ├── MongoBeanPropertyDocumentMapper-context.xml │ │ ├── config │ │ ├── MongoClientNamespaceTests-context.xml │ │ ├── MongoDbFactoryNoDatabaseRunningTests-context.xml │ │ ├── MongoNamespaceReplicaSetTests-context.xml │ │ ├── MongoNamespaceTests-context.xml │ │ ├── auditing.xml │ │ └── mongo.properties │ │ ├── core │ │ ├── index │ │ │ └── MongoPersistentEntityIndexCreatorIntegrationTests-context.xml │ │ └── mapping │ │ │ └── event │ │ │ └── ValidatingMongoEventListenerTests-context.xml │ │ ├── monitor │ │ └── MongoMonitorIntegrationTests-context.xml │ │ └── repository │ │ ├── PersonRepositoryIntegrationTests-context.xml │ │ ├── RepositoryIndexCreationIntegrationTests-context.xml │ │ ├── config │ │ ├── MongoNamespaceIntegrationTests-context.xml │ │ └── lazy │ │ │ └── AllowNestedMongoRepositoriesRepositoryConfigTests-context.xml │ │ └── mongo.properties │ ├── reactive-infrastructure.xml │ ├── reduce.js │ ├── replicaSet.properties │ ├── template-mapping.xml │ └── zips.json └── src └── main ├── antora ├── antora-playbook.yml ├── antora.yml ├── modules │ └── ROOT │ │ ├── assets │ │ └── images │ │ │ └── jconsole.png │ │ ├── examples │ │ └── example │ │ ├── nav.adoc │ │ ├── pages │ │ ├── commons │ │ │ └── upgrade.adoc │ │ ├── index.adoc │ │ ├── kotlin.adoc │ │ ├── kotlin │ │ │ ├── coroutines.adoc │ │ │ ├── extensions.adoc │ │ │ ├── null-safety.adoc │ │ │ └── requirements.adoc │ │ ├── migration-guide │ │ │ ├── migration-guide-2.x-to-3.x.adoc │ │ │ └── migration-guide-3.x-to-4.x.adoc │ │ ├── migration-guides.adoc │ │ ├── mongodb.adoc │ │ ├── mongodb │ │ │ ├── aggregation-framework.adoc │ │ │ ├── aot.adoc │ │ │ ├── auditing.adoc │ │ │ ├── change-streams.adoc │ │ │ ├── client-session-transactions.adoc │ │ │ ├── collation.adoc │ │ │ ├── configuration.adoc │ │ │ ├── converters-type-mapping.adoc │ │ │ ├── geo-json.adoc │ │ │ ├── getting-started.adoc │ │ │ ├── jmx.adoc │ │ │ ├── lifecycle-events.adoc │ │ │ ├── mapping │ │ │ │ ├── custom-conversions.adoc │ │ │ │ ├── document-references.adoc │ │ │ │ ├── mapping-index-management.adoc │ │ │ │ ├── mapping-schema.adoc │ │ │ │ ├── mapping.adoc │ │ │ │ ├── property-converters.adoc │ │ │ │ └── unwrapping-entities.adoc │ │ │ ├── mongo-encryption.adoc │ │ │ ├── mongo-group.adoc │ │ │ ├── mongo-mapreduce.adoc │ │ │ ├── mongo-search-indexes.adoc │ │ │ ├── mongo-server-side-scripts.adoc │ │ │ ├── repositories │ │ │ │ ├── cdi-integration.adoc │ │ │ │ ├── modifying-methods.adoc │ │ │ │ ├── query-methods.adoc │ │ │ │ ├── repositories.adoc │ │ │ │ └── vector-search.adoc │ │ │ ├── sharding.adoc │ │ │ ├── tailable-cursors.adoc │ │ │ ├── template-api.adoc │ │ │ ├── template-collection-management.adoc │ │ │ ├── template-config.adoc │ │ │ ├── template-crud-operations.adoc │ │ │ ├── template-document-count.adoc │ │ │ ├── template-gridfs.adoc │ │ │ ├── template-query-operations.adoc │ │ │ └── value-expressions.adoc │ │ ├── observability │ │ │ ├── conventions.adoc │ │ │ ├── metrics.adoc │ │ │ ├── observability.adoc │ │ │ └── spans.adoc │ │ ├── preface.adoc │ │ ├── repositories.adoc │ │ └── repositories │ │ │ ├── core-concepts.adoc │ │ │ ├── core-domain-events.adoc │ │ │ ├── core-extensions.adoc │ │ │ ├── create-instances.adoc │ │ │ ├── custom-implementations.adoc │ │ │ ├── definition.adoc │ │ │ ├── null-handling.adoc │ │ │ ├── projections.adoc │ │ │ ├── query-by-example.adoc │ │ │ ├── query-keywords-reference.adoc │ │ │ ├── query-methods-details.adoc │ │ │ └── query-return-types-reference.adoc │ │ └── partials │ │ ├── vector-search-intro-include.adoc │ │ ├── vector-search-method-annotated-include.adoc │ │ ├── vector-search-method-derived-include.adoc │ │ ├── vector-search-model-include.adoc │ │ ├── vector-search-repository-include.adoc │ │ ├── vector-search-scoring-include.adoc │ │ └── vector-search.adoc └── resources │ └── antora-resources │ └── antora.yml └── resources ├── license.txt └── notice.txt /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 7 | 8 | - [ ] You have read the [Spring Data contribution guidelines](https://github.com/spring-projects/spring-data-build/blob/master/CONTRIBUTING.adoc). 9 | - [ ] You use the code formatters provided [here](https://github.com/spring-projects/spring-data-build/tree/master/etc/ide) and have them applied to your changes. Don’t submit any formatting related changes. 10 | - [ ] You submit test cases (unit or integration tests) that back your changes. 11 | - [ ] You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only). 12 | -------------------------------------------------------------------------------- /.github/dco.yml: -------------------------------------------------------------------------------- 1 | require: 2 | members: false 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.iml 3 | *.ipr 4 | *.iws 5 | *.orig 6 | target 7 | .springBeans 8 | .sonar4clipse 9 | *.sonar4clipseExternals 10 | .ant-targets-build.xml 11 | .settings/ 12 | .project 13 | .classpath 14 | src/ant/.ant-targets-upload-dist.xml 15 | atlassian-ide-plugin.xml 16 | /.gradle/ 17 | /.idea/ 18 | *.graphml 19 | build/ 20 | node_modules 21 | node 22 | package-lock.json 23 | .mvn/.develocity 24 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | io.spring.develocity.conventions 5 | develocity-conventions-maven-extension 6 | 0.0.22 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mvn/jvm.config: -------------------------------------------------------------------------------- 1 | --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED 2 | --add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED 3 | --add-exports jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED 4 | --add-exports jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED 5 | --add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED 6 | --add-exports jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED 7 | --add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED 8 | --add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED 9 | --add-opens jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED 10 | --add-opens jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED 11 | --add-opens=java.base/java.util=ALL-UNNAMED 12 | --add-opens=java.base/java.lang.reflect=ALL-UNNAMED 13 | --add-opens=java.base/java.text=ALL-UNNAMED 14 | --add-opens=java.desktop/java.awt.font=ALL-UNNAMED 15 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-projects/spring-data-mongodb/4e53fa792e8582e19ea7498ee353a8bc0dbaa3a2/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Nov 07 09:47:19 CET 2024 2 | distributionUrl=https\://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 3 | -------------------------------------------------------------------------------- /CONTRIBUTING.adoc: -------------------------------------------------------------------------------- 1 | = Spring Data contribution guidelines 2 | 3 | You find the contribution guidelines for Spring Data projects https://github.com/spring-projects/spring-data-build/blob/main/CONTRIBUTING.adoc[here]. 4 | -------------------------------------------------------------------------------- /SECURITY.adoc: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Please see the https://spring.io/projects/spring-data-mongodb[Spring Data MongoDB] project page for supported versions. 6 | 7 | ## Reporting a Vulnerability 8 | 9 | Please don't raise security vulnerabilities here. Head over to https://pivotal.io/security to learn how to disclose them responsibly. 10 | -------------------------------------------------------------------------------- /ci/openjdk24-mongodb-8.0/Dockerfile: -------------------------------------------------------------------------------- 1 | ARG BASE 2 | FROM ${BASE} 3 | # Any ARG statements before FROM are cleared. 4 | ARG MONGODB 5 | 6 | ENV TZ=Etc/UTC 7 | ENV DEBIAN_FRONTEND=noninteractive 8 | ENV MONGO_VERSION=${MONGODB} 9 | 10 | RUN set -eux; \ 11 | sed -i -e 's/archive.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \ 12 | sed -i -e 's/security.ubuntu.com/mirror.one.com/g' /etc/apt/sources.list && \ 13 | sed -i -e 's/ports.ubuntu.com/mirrors.ocf.berkeley.edu/g' /etc/apt/sources.list && \ 14 | sed -i -e 's/http/https/g' /etc/apt/sources.list && \ 15 | apt-get update && apt-get install -y apt-transport-https apt-utils gnupg2 wget && \ 16 | # MongoDB 8.0 release signing key 17 | wget -qO - https://www.mongodb.org/static/pgp/server-8.0.asc | apt-key add - && \ 18 | # Needed when MongoDB creates a 8.0 folder. 19 | echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu noble/mongodb-org/8.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-8.0.list && \ 20 | echo ${TZ} > /etc/timezone 21 | 22 | RUN apt-get update && \ 23 | apt-get install -y mongodb-org=${MONGODB} mongodb-org-server=${MONGODB} mongodb-org-shell=${MONGODB} mongodb-org-mongos=${MONGODB} mongodb-org-tools=${MONGODB} && \ 24 | apt-get clean && \ 25 | rm -rf /var/lib/apt/lists/* 26 | -------------------------------------------------------------------------------- /ci/pipeline.properties: -------------------------------------------------------------------------------- 1 | # Java versions 2 | java.main.tag=24.0.1_9-jdk-noble 3 | java.next.tag=24.0.1_9-jdk-noble 4 | 5 | # Docker container images - standard 6 | docker.java.main.image=library/eclipse-temurin:${java.main.tag} 7 | docker.java.next.image=library/eclipse-temurin:${java.next.tag} 8 | 9 | # Supported versions of MongoDB 10 | docker.mongodb.8.0.version=8.0.9 11 | 12 | # Supported versions of Redis 13 | docker.redis.6.version=6.2.13 14 | docker.redis.7.version=7.2.4 15 | docker.valkey.8.version=8.1.1 16 | 17 | # Docker environment settings 18 | docker.java.inside.basic=-v $HOME:/tmp/jenkins-home 19 | docker.java.inside.docker=-u root -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker -v $HOME:/tmp/jenkins-home 20 | 21 | # Credentials 22 | docker.registry= 23 | docker.credentials=hub.docker.com-springbuildmaster 24 | docker.proxy.registry=https://docker-hub.usw1.packages.broadcom.com 25 | docker.proxy.credentials=usw1_packages_broadcom_com-jenkins-token 26 | artifactory.credentials=02bd1690-b54f-4c9f-819d-a77cb7a9822c 27 | artifactory.url=https://repo.spring.io 28 | artifactory.repository.snapshot=libs-snapshot-local 29 | develocity.access-key=gradle_enterprise_secret_access_key 30 | jenkins.user.name=spring-builds+jenkins 31 | -------------------------------------------------------------------------------- /ci/start-replica.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | mkdir -p /tmp/mongodb/db /tmp/mongodb/log 3 | mongod --setParameter transactionLifetimeLimitSeconds=90 --setParameter maxTransactionLockRequestTimeoutMillis=10000 --dbpath /tmp/mongodb/db --replSet rs0 --fork --logpath /tmp/mongodb/log/mongod.log & 4 | sleep 10 5 | mongosh --eval "rs.initiate({_id: 'rs0', members:[{_id: 0, host: '127.0.0.1:27017'}]});" 6 | sleep 15 7 | -------------------------------------------------------------------------------- /lombok.config: -------------------------------------------------------------------------------- 1 | lombok.nonNull.exceptionType = IllegalArgumentException 2 | lombok.log.fieldName = LOG 3 | -------------------------------------------------------------------------------- /settings.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | spring-plugins-release 9 | ${env.ARTIFACTORY_USR} 10 | ${env.ARTIFACTORY_PSW} 11 | 12 | 13 | spring-libs-snapshot 14 | ${env.ARTIFACTORY_USR} 15 | ${env.ARTIFACTORY_PSW} 16 | 17 | 18 | spring-libs-milestone 19 | ${env.ARTIFACTORY_USR} 20 | ${env.ARTIFACTORY_PSW} 21 | 22 | 23 | spring-libs-release 24 | ${env.ARTIFACTORY_USR} 25 | ${env.ARTIFACTORY_PSW} 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /spring-data-mongodb-distribution/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "antora": "3.2.0-alpha.6", 4 | "@antora/atlas-extension": "1.0.0-alpha.2", 5 | "@antora/collector-extension": "1.0.0-alpha.7", 6 | "@asciidoctor/tabs": "1.0.0-beta.6", 7 | "@springio/antora-extensions": "1.13.0", 8 | "@springio/asciidoctor-extensions": "1.0.0-alpha.11" 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/InvalidMongoDbApiUsageException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb; 17 | 18 | import org.springframework.dao.InvalidDataAccessApiUsageException; 19 | 20 | public class InvalidMongoDbApiUsageException extends InvalidDataAccessApiUsageException { 21 | 22 | private static final long serialVersionUID = 2034770973290508041L; 23 | 24 | public InvalidMongoDbApiUsageException(String msg) { 25 | super(msg); 26 | } 27 | 28 | public InvalidMongoDbApiUsageException(String msg, Throwable cause) { 29 | super(msg, cause); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/LazyLoadingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb; 17 | 18 | import org.springframework.dao.UncategorizedDataAccessException; 19 | 20 | /** 21 | * @author Oliver Gierke 22 | */ 23 | public class LazyLoadingException extends UncategorizedDataAccessException { 24 | 25 | private static final long serialVersionUID = -7089224903873220037L; 26 | 27 | /** 28 | * Constructor for LazyLoadingException. 29 | * 30 | * @param msg the detail message. 31 | * @param cause the exception thrown by underlying data access API. 32 | */ 33 | public LazyLoadingException(String msg, Throwable cause) { 34 | super(msg, cause); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/UncategorizedMongoDbException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | import org.springframework.dao.UncategorizedDataAccessException; 20 | 21 | public class UncategorizedMongoDbException extends UncategorizedDataAccessException { 22 | 23 | private static final long serialVersionUID = -2336595514062364929L; 24 | 25 | public UncategorizedMongoDbException(String msg, @Nullable Throwable cause) { 26 | super(msg, cause); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/aot/MongoAotReflectionHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.aot; 17 | 18 | import org.springframework.aot.hint.MemberCategory; 19 | import org.springframework.aot.hint.TypeHint.Builder; 20 | 21 | /** 22 | * @author Christoph Strobl 23 | */ 24 | public final class MongoAotReflectionHelper { 25 | 26 | public static void cglibProxyReflectionMemberAccess(Builder builder) { 27 | 28 | builder.withMembers(MemberCategory.INVOKE_DECLARED_CONSTRUCTORS, MemberCategory.INVOKE_DECLARED_METHODS, 29 | MemberCategory.DECLARED_FIELDS); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/GeoJsonConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.config; 17 | 18 | import org.springframework.context.annotation.Bean; 19 | import org.springframework.data.mongodb.core.geo.GeoJsonModule; 20 | import org.springframework.data.web.config.SpringDataJacksonModules; 21 | 22 | /** 23 | * Configuration class to expose {@link GeoJsonModule} as a Spring bean. 24 | * 25 | * @author Oliver Gierke 26 | * @author Jens Schauder 27 | */ 28 | public class GeoJsonConfiguration implements SpringDataJacksonModules { 29 | 30 | @Bean 31 | public GeoJsonModule geoJsonModule() { 32 | return new GeoJsonModule(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/StringToWriteConcernConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.config; 17 | 18 | import org.springframework.core.convert.converter.Converter; 19 | 20 | import com.mongodb.WriteConcern; 21 | 22 | /** 23 | * Converter to create {@link WriteConcern} instances from String representations. 24 | * 25 | * @author Oliver Gierke 26 | */ 27 | public class StringToWriteConcernConverter implements Converter { 28 | 29 | public WriteConcern convert(String source) { 30 | 31 | WriteConcern writeConcern = WriteConcern.valueOf(source); 32 | return writeConcern != null ? writeConcern : new WriteConcern(source); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring XML namespace configuration for MongoDB specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.config; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DefaultWriteConcernResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | import com.mongodb.WriteConcern; 21 | 22 | /** 23 | * Default {@link WriteConcernResolver} resolving the {@link WriteConcern} from the given {@link MongoAction}. 24 | * 25 | * @author Oliver Gierke 26 | */ 27 | enum DefaultWriteConcernResolver implements WriteConcernResolver { 28 | 29 | INSTANCE; 30 | 31 | public @Nullable WriteConcern resolve(MongoAction action) { 32 | return action.getDefaultWriteConcern(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EncryptionAlgorithms.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | /** 19 | * Encryption algorithms supported by MongoDB Client Side Field Level Encryption. 20 | * 21 | * @author Christoph Strobl 22 | * @author Ross Lawley 23 | * @since 3.3 24 | */ 25 | public final class EncryptionAlgorithms { 26 | 27 | public static final String AEAD_AES_256_CBC_HMAC_SHA_512_Deterministic = "AEAD_AES_256_CBC_HMAC_SHA_512-Deterministic"; 28 | public static final String AEAD_AES_256_CBC_HMAC_SHA_512_Random = "AEAD_AES_256_CBC_HMAC_SHA_512-Random"; 29 | public static final String RANGE = "Range"; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityResultConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.bson.Document; 19 | 20 | enum EntityResultConverter implements QueryResultConverter { 21 | 22 | INSTANCE; 23 | 24 | @Override 25 | public Object mapDocument(Document document, ConversionResultSupplier reader) { 26 | return reader.get(); 27 | } 28 | 29 | @Override 30 | public QueryResultConverter andThen(QueryResultConverter after) { 31 | return (QueryResultConverter) after; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FluentMongoOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | /** 19 | * Stripped down interface providing access to a fluent API that specifies a basic set of MongoDB operations. 20 | * 21 | * @author Christoph Strobl 22 | * @since 2.0 23 | */ 24 | public interface FluentMongoOperations extends ExecutableFindOperation, ExecutableInsertOperation, 25 | ExecutableUpdateOperation, ExecutableRemoveOperation, ExecutableAggregationOperation, ExecutableMapReduceOperation {} 26 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoActionOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | /** 19 | * Enumeration for operations on a collection. Used with {@link MongoAction} to help determine the WriteConcern to use 20 | * for a given mutating operation 21 | * 22 | * @author Mark Pollack 23 | * @author Oliver Gierke 24 | * @author Christoph Strobl 25 | * @see MongoAction 26 | */ 27 | public enum MongoActionOperation { 28 | 29 | REMOVE, UPDATE, INSERT, INSERT_LIST, SAVE, BULK, REPLACE 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoAdminOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.springframework.jmx.export.annotation.ManagedOperation; 19 | 20 | /** 21 | * @author Mark Pollack 22 | * @author Oliver Gierke 23 | */ 24 | @Deprecated(since = "4.5", forRemoval = true) 25 | public interface MongoAdminOperations { 26 | 27 | @ManagedOperation 28 | void dropDatabase(String databaseName); 29 | 30 | @ManagedOperation 31 | void createDatabase(String databaseName); 32 | 33 | @ManagedOperation 34 | String getDatabaseStats(String databaseName); 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveCollectionCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.bson.Document; 19 | import org.reactivestreams.Publisher; 20 | import org.springframework.dao.DataAccessException; 21 | 22 | import com.mongodb.MongoException; 23 | import com.mongodb.reactivestreams.client.MongoCollection; 24 | 25 | /** 26 | * @author Mark Paluch 27 | * @param 28 | * @since 2.0 29 | */ 30 | public interface ReactiveCollectionCallback { 31 | 32 | Publisher doInCollection(MongoCollection collection) throws MongoException, DataAccessException; 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveDatabaseCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.springframework.dao.DataAccessException; 19 | 20 | import com.mongodb.MongoException; 21 | import com.mongodb.reactivestreams.client.MongoDatabase; 22 | import org.reactivestreams.Publisher; 23 | 24 | /** 25 | * @author Mark Paluch 26 | * @param 27 | * @since 2.0 28 | */ 29 | public interface ReactiveDatabaseCallback { 30 | 31 | Publisher doInDB(MongoDatabase db) throws MongoException, DataAccessException; 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveFluentMongoOperations.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | /** 19 | * Stripped down interface providing access to a fluent API that specifies a basic set of reactive MongoDB operations. 20 | * 21 | * @author Mark Paluch 22 | * @author Christoph Strobl 23 | * @since 2.0 24 | */ 25 | public interface ReactiveFluentMongoOperations extends ReactiveFindOperation, ReactiveInsertOperation, 26 | ReactiveUpdateOperation, ReactiveRemoveOperation, ReactiveAggregationOperation, ReactiveMapReduceOperation, ReactiveChangeStreamOperation {} 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/SortingQueryCursorPreparer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.bson.Document; 19 | import org.jspecify.annotations.Nullable; 20 | 21 | /** 22 | * {@link CursorPreparer} that exposes its {@link Document sort document}. 23 | * 24 | * @author Christoph Strobl 25 | * @since 4.4.3 26 | */ 27 | interface SortingQueryCursorPreparer extends CursorPreparer { 28 | 29 | @Nullable 30 | Document getSortObject(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/WriteResultChecking.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | /** 19 | * Enum to represent how strict the check of {@link com.mongodb.WriteConcernResult} shall be. It can either be skipped 20 | * entirely (use {@link #NONE}) or cause an exception to be thrown {@link #EXCEPTION}. 21 | * 22 | * @author Thomas Risberg 23 | * @author Oliver Gierke 24 | */ 25 | public enum WriteResultChecking { 26 | 27 | NONE, EXCEPTION 28 | } 29 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support for the MongoDB aggregation framework. 3 | * 4 | * @since 1.3 5 | */ 6 | @org.jspecify.annotations.NullMarked 7 | package org.springframework.data.mongodb.core.aggregation; 8 | 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/annotation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Core Spring Data MongoDB annotations not limited to a special use case (like Query,...). 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.annotation; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/DbRefProxyHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.convert; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | import org.springframework.data.mongodb.core.mapping.MongoPersistentProperty; 20 | 21 | import com.mongodb.DBRef; 22 | 23 | /** 24 | * @author Oliver Gierke 25 | * @author Mark Paluch 26 | */ 27 | public interface DbRefProxyHandler { 28 | 29 | Object populateId(MongoPersistentProperty property, @Nullable DBRef source, Object proxy); 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/MongoValueConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.convert; 17 | 18 | import org.springframework.data.convert.PropertyValueConverter; 19 | 20 | /** 21 | * MongoDB-specific {@link PropertyValueConverter} extension. 22 | * 23 | * @author Christoph Strobl 24 | * @since 3.4 25 | */ 26 | public interface MongoValueConverter extends PropertyValueConverter {} 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/encryption/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Converters integrating with 3 | * explicit encryption 4 | * mechanism of Client-Side Field Level Encryption. 5 | */ 6 | @org.jspecify.annotations.NullMarked 7 | package org.springframework.data.mongodb.core.convert.encryption; 8 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/convert/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data MongoDB specific converter infrastructure. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.convert; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/encryption/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure for explicit 3 | * encryption mechanism of Client-Side Field Level Encryption. 4 | */ 5 | @org.jspecify.annotations.NullMarked 6 | package org.springframework.data.mongodb.core.encryption; 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/geo/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support for MongoDB geo-spatial queries. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.geo; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/GeoSpatialIndexType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.index; 17 | 18 | /** 19 | * Geoposatial index type. 20 | * 21 | * @author Laurent Canet 22 | * @author Oliver Gierke 23 | * @since 1.4 24 | */ 25 | public enum GeoSpatialIndexType { 26 | 27 | /** 28 | * Simple 2-Dimensional index for legacy-format points. 29 | */ 30 | GEO_2D, 31 | 32 | /** 33 | * 2D Index for GeoJSON-formatted data over a sphere. Only available in Mongo 2.4. 34 | */ 35 | GEO_2DSPHERE, 36 | 37 | /** 38 | * An haystack index for grouping results over small results. 39 | */ 40 | GEO_HAYSTACK 41 | } 42 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.index; 17 | 18 | import org.bson.Document; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | * @author Christoph Strobl 23 | * @author Mark Paluch 24 | */ 25 | public interface IndexDefinition { 26 | 27 | /** 28 | * Get the {@link Document} containing properties covered by the index. 29 | * 30 | * @return never {@literal null}. 31 | */ 32 | Document getIndexKeys(); 33 | 34 | /** 35 | * Get the index properties such as {@literal unique},... 36 | * 37 | * @return never {@literal null}. 38 | */ 39 | Document getIndexOptions(); 40 | } 41 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexDirection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.index; 17 | 18 | /** 19 | * @author Jon Brisbin 20 | */ 21 | public enum IndexDirection { 22 | ASCENDING, DESCENDING 23 | } 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.index; 17 | 18 | import org.bson.Document; 19 | 20 | /** 21 | * Use {@link IndexFilter} to create the partial filter expression used when creating 22 | * Partial Indexes. 23 | * 24 | * @author Christoph Strobl 25 | * @since 1.10 26 | */ 27 | public interface IndexFilter { 28 | 29 | /** 30 | * Get the raw (unmapped) filter expression. 31 | * 32 | * @return never {@literal null}. 33 | */ 34 | Document getFilterObject(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveIndexOperationsProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.index; 17 | 18 | /** 19 | * Provider interface to obtain {@link ReactiveIndexOperations} by MongoDB collection name. 20 | * 21 | * @author Mark Paluch 22 | * @since 2.1 23 | */ 24 | @FunctionalInterface 25 | public interface ReactiveIndexOperationsProvider { 26 | 27 | /** 28 | * Returns the operations that can be performed on indexes. 29 | * 30 | * @param collectionName name of the MongoDB collection, must not be {@literal null}. 31 | * @return index operations on the named collection 32 | */ 33 | ReactiveIndexOperations indexOps(String collectionName); 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support for MongoDB document indexing. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.index; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/Language.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * Mark property as language field. 26 | * 27 | * @author Christoph Strobl 28 | * @since 1.6 29 | */ 30 | @Documented 31 | @Target({ ElementType.FIELD }) 32 | @Retention(RetentionPolicy.RUNTIME) 33 | public @interface Language { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/ShardingStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | * @since 3.0 21 | */ 22 | public enum ShardingStrategy { 23 | 24 | /** 25 | * Ranged sharding involves dividing data into ranges based on the shard key values. Each chunk is then assigned a 26 | * range based on the shard key values. 27 | */ 28 | RANGE, 29 | 30 | /** 31 | * Hashed Sharding involves computing a hash of the shard key field’s value. Each chunk is then assigned a range based 32 | * on the hashed shard key values. 33 | */ 34 | HASH 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Mapping event callback infrastructure for the MongoDB document-to-object mapping subsystem. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.mapping.event; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapping/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure for the MongoDB document-to-object mapping subsystem. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.mapping; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/mapreduce/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support for MongoDB map-reduce operations. 3 | * @deprecated since MongoDB server version 5.0 4 | */ 5 | @Deprecated 6 | @org.jspecify.annotations.NullMarked 7 | package org.springframework.data.mongodb.core.mapreduce; 8 | 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/Cancelable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.messaging; 17 | 18 | import org.springframework.dao.DataAccessResourceFailureException; 19 | 20 | /** 21 | * Cancelable allows stopping long running tasks and freeing underlying resources. 22 | * 23 | * @author Christoph Strobl 24 | * @since 2.1 25 | */ 26 | public interface Cancelable { 27 | 28 | /** 29 | * Abort and free resources. 30 | * 31 | * @throws DataAccessResourceFailureException if operation cannot be canceled. 32 | */ 33 | void cancel() throws DataAccessResourceFailureException; 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/MessageListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.messaging; 17 | 18 | /** 19 | * Listener interface to receive delivery of {@link Message Messages}. 20 | * 21 | * @author Christoph Strobl 22 | * @param source message type. 23 | * @param target message type. 24 | * @since 2.1 25 | */ 26 | @FunctionalInterface 27 | public interface MessageListener { 28 | 29 | /** 30 | * Callback invoked on receiving {@link Message}. 31 | * 32 | * @param message never {@literal null}. 33 | */ 34 | void onMessage(Message message); 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/messaging/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB specific messaging support for listening to eg. 3 | * Change Streams. 4 | */ 5 | @org.jspecify.annotations.NullMarked 6 | package org.springframework.data.mongodb.core.messaging; 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB core support. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB specific query and update support. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.core.query; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/schema/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB-specific JSON schema implementation classes. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.mongodb.core.schema; 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/script/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Abstraction classes javascript function execution within MongoDB Server. 3 | * 4 | * @since 1.7 5 | */ 6 | @org.jspecify.annotations.NullMarked 7 | package org.springframework.data.mongodb.core.script; 8 | 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/ExpressionTransformer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.spel; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | /** 21 | * SPI interface to implement components that can transform an {@link ExpressionTransformationContextSupport} into an 22 | * object. 23 | * 24 | * @author Oliver Gierke 25 | */ 26 | public interface ExpressionTransformer> { 27 | 28 | /** 29 | * Transforms the given {@link ExpressionTransformationContextSupport} into an Object. 30 | * 31 | * @param context will never be {@literal null}. 32 | * @return 33 | */ 34 | @Nullable Object transform(T context); 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/spel/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support classes to transform SpEL expressions into MongoDB expressions. 3 | * 4 | * @since 1.4 5 | */ 6 | @org.jspecify.annotations.NullMarked 7 | package org.springframework.data.mongodb.core.spel; 8 | 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/timeseries/Granularity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.timeseries; 17 | 18 | /** 19 | * {@link GranularityDefinition Granularities} available for Time Series data. 20 | * 21 | * @author Christoph Strobl 22 | * @since 3.3 23 | */ 24 | public enum Granularity implements GranularityDefinition { 25 | 26 | /** 27 | * Server default value to indicate no explicit value should be sent. 28 | */ 29 | DEFAULT, 30 | 31 | /** 32 | * High frequency ingestion. 33 | */ 34 | SECONDS, 35 | 36 | /** 37 | * Medium frequency ingestion. 38 | */ 39 | MINUTES, 40 | 41 | /** 42 | * Low frequency ingestion. 43 | */ 44 | HOURS 45 | } 46 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/timeseries/GranularityDefinition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.timeseries; 17 | 18 | /** 19 | * The Granularity of time series data that is closest to the time span between incoming measurements. 20 | * 21 | * @author Christoph Strobl 22 | * @since 3.3 23 | */ 24 | public interface GranularityDefinition { 25 | 26 | String name(); 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/validation/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB schema validation specifics. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | @org.springframework.lang.NonNullFields 6 | package org.springframework.data.mongodb.core.validation; 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/gridfs/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support for MongoDB GridFS feature. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.gridfs; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/observability/MongoHandlerObservationConvention.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2022-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.observability; 17 | 18 | import io.micrometer.observation.Observation; 19 | import io.micrometer.observation.ObservationConvention; 20 | 21 | /** 22 | * {@link ObservationConvention} for {@link MongoHandlerContext}. 23 | * 24 | * @author Greg Turnquist 25 | * @since 4 26 | */ 27 | public interface MongoHandlerObservationConvention extends ObservationConvention { 28 | 29 | @Override 30 | default boolean supportsContext(Observation.Context context) { 31 | return context instanceof MongoHandlerContext; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/observability/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Infrastructure to provide driver observability using Micrometer. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.observability; 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Spring Data's MongoDB abstraction. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb; 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/StringAggregation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.aot; 17 | 18 | /** 19 | * Value object holding the raw representation of an Aggregation Pipeline. 20 | * 21 | * @author Christoph Strobl 22 | * @since 5.0 23 | */ 24 | record StringAggregation(String[] pipeline) { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/StringUpdate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.aot; 17 | 18 | /** 19 | * @author Christoph Strobl 20 | * @since 5.0 21 | */ 22 | record StringUpdate(String raw) { 23 | 24 | String getUpdateString() { 25 | return raw; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/aot/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Ahead-Of-Time processors for MongoDB repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository.aot; 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/cdi/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * CDI support for MongoDB specific repository implementation. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository.cdi; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support infrastructure for the configuration of MongoDB specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository.config; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB specific repository implementation. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/query/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Query derivation mechanism for MongoDB specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository.query; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/repository/support/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Support infrastructure for query derivation of MongoDB specific repositories. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.repository.support; 6 | 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/DBObjectUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.util; 17 | 18 | import java.util.Arrays; 19 | 20 | import com.mongodb.BasicDBList; 21 | 22 | /** 23 | * @author Thomas Darimont 24 | * @deprecated since 4.2.0 25 | */ 26 | @Deprecated(since = "4.2.0", forRemoval = true) 27 | public class DBObjectUtils { 28 | 29 | public static BasicDBList dbList(Object... items) { 30 | 31 | BasicDBList list = new BasicDBList(); 32 | list.addAll(Arrays.asList(items)); 33 | return list; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/ValueProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.util.json; 17 | 18 | import org.jspecify.annotations.Nullable; 19 | 20 | /** 21 | * A value provider to retrieve bindable values by their parameter index. 22 | * 23 | * @author Christoph Strobl 24 | * @since 2.2 25 | */ 26 | @FunctionalInterface 27 | public interface ValueProvider { 28 | 29 | /** 30 | * @param index parameter index to use. 31 | * @return can be {@literal null}. 32 | * @throws RuntimeException if the requested element does not exist. 33 | */ 34 | @Nullable 35 | Object getBindableValue(int index); 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/json/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB driver-specific utility classes for Json conversion. 3 | */ 4 | @org.jspecify.annotations.NullMarked 5 | package org.springframework.data.mongodb.util.json; 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/java/org/springframework/data/mongodb/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MongoDB driver-specific utility classes for {@link org.bson.conversions.Bson} and {@link com.mongodb.DBObject} 3 | * interaction. 4 | */ 5 | @org.jspecify.annotations.NullMarked 6 | package org.springframework.data.mongodb.util; 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/ExecutableAggregationOperationExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | /** 19 | * Extension for [ExecutableAggregationOperation.aggregateAndReturn] leveraging reified type parameters. 20 | * 21 | * @author Sebastien Deleuze 22 | * @author Mark Paluch 23 | * @since 2.0 24 | */ 25 | inline fun ExecutableAggregationOperation.aggregateAndReturn(): ExecutableAggregationOperation.ExecutableAggregation = 26 | aggregateAndReturn(T::class.java) 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/ExecutableInsertOperationExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | /** 19 | * Extension for [ExecutableInsertOperation.insert] leveraging reified type parameters. 20 | * 21 | * @author Sebastien Deleuze 22 | * @author Mark Paluch 23 | * @since 2.0 24 | */ 25 | inline fun ExecutableInsertOperation.insert(): ExecutableInsertOperation.ExecutableInsert = 26 | insert(T::class.java) 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/ExecutableRemoveOperationExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | /** 19 | * Extension for [ExecutableRemoveOperation.remove] leveraging reified type parameters. 20 | * 21 | * @author Sebastien Deleuze 22 | * @author Mark Paluch 23 | * @since 2.0 24 | */ 25 | inline fun ExecutableRemoveOperation.remove(): ExecutableRemoveOperation.ExecutableRemove = 26 | remove(T::class.java) 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/ExecutableUpdateOperationExtensions.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | /** 19 | * Extension for [ExecutableUpdateOperation.update] leveraging reified type parameters. 20 | * 21 | * @author Christoph Strobl 22 | * @since 2.0 23 | */ 24 | inline fun ExecutableUpdateOperation.update(): ExecutableUpdateOperation.ExecutableUpdate = 25 | update(T::class.java) 26 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/resources/META-INF/services/jakarta.enterprise.inject.spi.Extension: -------------------------------------------------------------------------------- 1 | org.springframework.data.mongodb.repository.cdi.MongoRepositoryExtension -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/resources/META-INF/spring.factories: -------------------------------------------------------------------------------- 1 | org.springframework.data.web.config.SpringDataJacksonModules=org.springframework.data.mongodb.config.GeoJsonConfiguration 2 | org.springframework.data.repository.core.support.RepositoryFactorySupport=org.springframework.data.mongodb.repository.support.MongoRepositoryFactory 3 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/resources/META-INF/spring.handlers: -------------------------------------------------------------------------------- 1 | http\://www.springframework.org/schema/data/mongo=org.springframework.data.mongodb.repository.config.MongoRepositoryConfigNamespaceHandler 2 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/resources/META-INF/spring.tooling: -------------------------------------------------------------------------------- 1 | # Tooling related information for the Mongo DB namespace 2 | http\://www.springframework.org/schema/data/mongo@name=Mongo Namespace 3 | http\://www.springframework.org/schema/data/mongo@prefix=mongo 4 | http\://www.springframework.org/schema/data/mongo@icon=org/springframework/jdbc/config/spring-jdbc.gif 5 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/main/resources/META-INF/spring/aot.factories: -------------------------------------------------------------------------------- 1 | org.springframework.aot.hint.RuntimeHintsRegistrar=\ 2 | org.springframework.data.mongodb.aot.MongoRuntimeHints,\ 3 | org.springframework.data.mongodb.repository.aot.RepositoryRuntimeHints 4 | 5 | org.springframework.beans.factory.aot.BeanRegistrationAotProcessor=\ 6 | org.springframework.data.mongodb.aot.MongoManagedTypesBeanRegistrationAotProcessor 7 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/ConfigClassInDefaultPackageUnitTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | import org.junit.jupiter.api.Test; 18 | 19 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; 20 | 21 | /** 22 | * Unit test for {@link ConfigClassInDefaultPackage}. 23 | * 24 | * @author Oliver Gierke 25 | */ 26 | public class ConfigClassInDefaultPackageUnitTests { 27 | 28 | @Test // DATAMONGO-877 29 | public void loadsConfigClassFromDefaultPackage() { 30 | new AnnotationConfigApplicationContext(ConfigClassInDefaultPackage.class).close(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/example/aot/UserProjection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example.aot; 17 | 18 | import java.time.Instant; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public interface UserProjection { 24 | 25 | String getUsername(); 26 | 27 | Instant getLastSeen(); 28 | } 29 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/example/first/First.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example.first; 17 | 18 | import org.springframework.data.mongodb.core.mapping.Document; 19 | 20 | /** 21 | * @author Oliver Gierke 22 | */ 23 | @Document 24 | public class First { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/example/second/Second.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package example.second; 17 | 18 | import org.springframework.data.mongodb.core.mapping.Document; 19 | 20 | /** 21 | * @author Oliver Gierke 22 | */ 23 | @Document 24 | public class Second { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/SpringDataMongoDBTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2020-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb; 17 | 18 | import static org.assertj.core.api.Assertions.*; 19 | 20 | import org.junit.jupiter.api.Test; 21 | 22 | /** 23 | * @author Christoph Strobl 24 | */ 25 | class SpringDataMongoDBTests { 26 | 27 | @Test // DATAMONGO-2427 28 | void driverInformationHoldsSpringDataHint() { 29 | assertThat(SpringDataMongoDB.driverInformation().getDriverNames()).contains("spring-data"); 30 | } 31 | 32 | @Test // DATAMONGO-2427 33 | void versionIsDetectedFromPackage() { 34 | assertThat(SpringDataMongoDB.version()).isNotNull(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/config/CustomMongoTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.config; 17 | 18 | import org.springframework.data.mongodb.core.convert.DefaultMongoTypeMapper; 19 | 20 | /** 21 | * @author Thomas Darimont 22 | */ 23 | class CustomMongoTypeMapper extends DefaultMongoTypeMapper {} 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/BaseDoc.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core; 2 | 3 | import org.springframework.data.annotation.Id; 4 | 5 | public class BaseDoc { 6 | @Id String id; 7 | String value; 8 | } 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/Friend.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | public class Friend { 19 | 20 | private String id; 21 | 22 | private String firstName; 23 | 24 | private int age; 25 | 26 | public String getId() { 27 | return id; 28 | } 29 | 30 | public void setId(String id) { 31 | this.id = id; 32 | } 33 | 34 | public String getFirstName() { 35 | return firstName; 36 | } 37 | 38 | public void setFirstName(String firstName) { 39 | this.firstName = firstName; 40 | } 41 | 42 | public int getAge() { 43 | return age; 44 | } 45 | 46 | public void setAge(int age) { 47 | this.age = age; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/PersonReadConverter.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core; 2 | 3 | import org.bson.Document; 4 | import org.bson.types.ObjectId; 5 | import org.springframework.core.convert.converter.Converter; 6 | 7 | public class PersonReadConverter implements Converter { 8 | 9 | public Person convert(Document source) { 10 | Person p = new Person((ObjectId) source.get("_id"), (String) source.get("name")); 11 | p.setAge((Integer) source.get("age")); 12 | return p; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/PersonWithVersionPropertyOfTypeInteger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.springframework.data.annotation.Version; 19 | 20 | public class PersonWithVersionPropertyOfTypeInteger { 21 | 22 | String id; 23 | String firstName; 24 | int age; 25 | 26 | @Version Integer version; 27 | 28 | @Override 29 | public String toString() { 30 | return "PersonWithVersionPropertyOfTypeInteger [id=" + id + ", firstName=" + firstName + ", age=" + age 31 | + ", version=" + version + "]"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/PersonWithVersionPropertyOfTypeLong.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.springframework.data.annotation.Version; 19 | 20 | public class PersonWithVersionPropertyOfTypeLong { 21 | 22 | String id; 23 | String firstName; 24 | int age; 25 | 26 | @Version Long version; 27 | 28 | @Override 29 | public String toString() { 30 | return "PersonWithVersionPropertyOfTypeLong [id=" + id + ", firstName=" + firstName + ", age=" + age + ", version=" 31 | + version + "]"; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/PersonWriteConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core; 17 | 18 | import org.bson.Document; 19 | import org.springframework.core.convert.converter.Converter; 20 | 21 | /** 22 | * @author Thomas Risberg 23 | * @author Oliver Gierke 24 | * @author Christoph Strobl 25 | * @author Mark Paluch 26 | */ 27 | public class PersonWriteConverter implements Converter { 28 | 29 | public Document convert(Person source) { 30 | Document document = new Document(); 31 | document.put("_id", source.getId()); 32 | document.put("name", source.getFirstName()); 33 | document.put("age", source.getAge()); 34 | return document; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/SpecialDoc.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core; 2 | 3 | public class SpecialDoc extends BaseDoc { 4 | String specialValue; 5 | } 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/TradeBatch.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core; 2 | 3 | import java.util.List; 4 | 5 | public class TradeBatch { 6 | 7 | private String batchId; 8 | 9 | private Trade[] trades; 10 | 11 | private List tradeList; 12 | 13 | public String getBatchId() { 14 | return batchId; 15 | } 16 | 17 | public void setBatchId(String batchId) { 18 | this.batchId = batchId; 19 | } 20 | 21 | public Trade[] getTrades() { 22 | return trades; 23 | } 24 | 25 | public void setTrades(Trade[] trades) { 26 | this.trades = trades; 27 | } 28 | 29 | public List getTradeList() { 30 | return tradeList; 31 | } 32 | 33 | public void setTradeList(List tradeList) { 34 | this.tradeList = tradeList; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/VerySpecialDoc.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core; 2 | 3 | public class VerySpecialDoc extends SpecialDoc { 4 | int verySpecialValue; 5 | } 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/Data.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | import java.util.Date; 19 | 20 | /** 21 | * @author Thomas Darimont 22 | */ 23 | class Data { 24 | public long primitiveLongValue; 25 | public double primitiveDoubleValue; 26 | public Double doubleValue; 27 | public Date dateValue; 28 | public String stringValue; 29 | 30 | public DataItem item; 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/DataItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | /** 19 | * @author Thomas Darimont 20 | */ 21 | class DataItem { 22 | int primitiveIntValue; 23 | } 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/LikeStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | import org.springframework.data.mongodb.core.mapping.Field; 19 | 20 | /** 21 | * @author Thomas Darimont 22 | */ 23 | public class LikeStats { 24 | 25 | String id; 26 | @Field("number") long count; 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/MatchOperationUnitTests.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.aggregation; 2 | 3 | 4 | import static org.springframework.data.mongodb.test.util.Assertions.*; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | /** 9 | * Unit tests for {@link MatchOperation}. 10 | * 11 | * @author Divya Srivastava 12 | */ 13 | class MatchOperationUnitTests { 14 | 15 | @Test // GH-3790 16 | void matchShouldRenderCorrectly() { 17 | 18 | MatchOperation operation = Aggregation.match(ArithmeticOperators.valueOf("quiz").stdDevPop()); 19 | assertThat(operation.toDocument(Aggregation.DEFAULT_CONTEXT)). 20 | isEqualTo("{ $match: { \"$stdDevPop\" : \"$quiz\" } } "); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/MeterData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | import org.springframework.data.annotation.Id; 19 | import org.springframework.data.mongodb.core.mapping.Field; 20 | 21 | /** 22 | * @author Thomas Darimont 23 | */ 24 | public class MeterData { 25 | 26 | @Id String id; 27 | String resourceId; 28 | @Field("counter_name") String counterName; 29 | double counterVolume; 30 | 31 | public MeterData(String resourceId, String counterName, double counterVolume) { 32 | 33 | this.resourceId = resourceId; 34 | this.counterName = counterName; 35 | this.counterVolume = counterVolume; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/Product.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | /** 19 | * @author Thomas Darimont 20 | */ 21 | public class Product { 22 | String id; 23 | String name; 24 | double netPrice; 25 | int spaceUnits; 26 | double discountRate; 27 | double taxRate; 28 | 29 | public Product() {} 30 | 31 | public Product(String id, String name, double netPrice, int spaceUnits, double discountRate, double taxRate) { 32 | this.id = id; 33 | this.name = name; 34 | this.netPrice = netPrice; 35 | this.spaceUnits = spaceUnits; 36 | this.discountRate = discountRate; 37 | this.taxRate = taxRate; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/StateStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.aggregation; 17 | 18 | import org.springframework.data.annotation.Id; 19 | import org.springframework.data.mongodb.core.mapping.Field; 20 | 21 | /** 22 | * @author Thomas Darimont 23 | */ 24 | class StateStats { 25 | @Id String id; 26 | String state; 27 | @Field("totalPop") int totalPopulation; 28 | } 29 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/TagCount.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.aggregation; 2 | 3 | /** 4 | * Simple value object holding the aggregation result. 5 | * 6 | * @author Tobias Trelle 7 | */ 8 | public class TagCount { 9 | 10 | private String tag; 11 | 12 | private int n; 13 | 14 | public String getTag() { 15 | return tag; 16 | } 17 | 18 | public void setTag(String tag) { 19 | this.tag = tag; 20 | } 21 | 22 | public int getN() { 23 | return n; 24 | } 25 | 26 | public void setN(int n) { 27 | this.n = n; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ZipInfo.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.aggregation; 2 | 3 | import java.util.Arrays; 4 | 5 | import org.springframework.data.mongodb.core.mapping.Field; 6 | 7 | /** 8 | * Data model from mongodb reference data set 9 | * 10 | * @see Aggregation Examples 11 | * @see 22 | */ 23 | @Document 24 | public class Account { 25 | 26 | @Id 27 | private String id; 28 | private Float balance; 29 | 30 | public String getId() { 31 | return id; 32 | } 33 | 34 | public void setId(String id) { 35 | this.id = id; 36 | } 37 | 38 | public Float getBalance() { 39 | return balance; 40 | } 41 | 42 | public void setBalance(Float balance) { 43 | this.balance = balance; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/CustomCollectionWithIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | import org.springframework.data.mongodb.core.index.Indexed; 20 | 21 | /** 22 | * @author Jon Brisbin 23 | */ 24 | @Document("foobar") 25 | public class CustomCollectionWithIndex { 26 | 27 | @Id private String id; 28 | @Indexed private String name; 29 | 30 | public CustomCollectionWithIndex(String name) { 31 | this.name = name; 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/DetectedCollectionWithIndex.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | import org.springframework.data.mongodb.core.index.Indexed; 20 | 21 | /** 22 | * @author Jon Brisbin 23 | */ 24 | @Document 25 | public class DetectedCollectionWithIndex { 26 | 27 | @Id private String id; 28 | @Indexed private String name; 29 | 30 | public DetectedCollectionWithIndex(String name) { 31 | this.name = name; 32 | } 33 | 34 | public String getName() { 35 | return name; 36 | } 37 | 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/GeneratedId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.bson.types.ObjectId; 19 | 20 | import org.springframework.data.annotation.Id; 21 | 22 | /** 23 | * @author Jon Brisbin 24 | */ 25 | @Document 26 | public class GeneratedId { 27 | 28 | @Id private ObjectId id; 29 | @SuppressWarnings("unused") private String name; 30 | 31 | public GeneratedId(String name) { 32 | this.name = name; 33 | } 34 | 35 | public ObjectId getId() { 36 | return id; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonCustomCollection1.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | @Document("person1") 24 | public class PersonCustomCollection1 extends BasePerson { 25 | 26 | @Id private String id; 27 | 28 | public PersonCustomCollection1(Integer ssn, String firstName, String lastName) { 29 | super(ssn, firstName, lastName); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonCustomCollection2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | @Document("person2") 24 | public class PersonCustomCollection2 extends BasePerson { 25 | 26 | @Id private String id; 27 | 28 | public PersonCustomCollection2(Integer ssn, String firstName, String lastName) { 29 | super(ssn, firstName, lastName); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonMultiCollection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | public class PersonMultiCollection extends BasePerson { 24 | 25 | private List> grid; 26 | 27 | public PersonMultiCollection(Integer ssn, String firstName, String lastName, List> grid) { 28 | super(ssn, firstName, lastName); 29 | this.grid = grid; 30 | } 31 | 32 | public List> getGrid() { 33 | return grid; 34 | } 35 | 36 | public void setGrid(List> grid) { 37 | this.grid = grid; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonMultiDimArrays.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | @Document 24 | public class PersonMultiDimArrays extends BasePerson { 25 | 26 | @Id private String id; 27 | private String[][] grid; 28 | 29 | public PersonMultiDimArrays(Integer ssn, String firstName, String lastName, String[][] grid) { 30 | super(ssn, firstName, lastName); 31 | this.grid = grid; 32 | } 33 | 34 | public String[][] getGrid() { 35 | return grid; 36 | } 37 | 38 | public void setGrid(String[][] grid) { 39 | this.grid = grid; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonNullProperties.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.bson.types.ObjectId; 19 | 20 | import org.springframework.data.annotation.Id; 21 | 22 | /** 23 | * @author Jon Brisbin 24 | */ 25 | @Document 26 | public class PersonNullProperties extends BasePerson { 27 | 28 | @Id private ObjectId id; 29 | 30 | public PersonNullProperties() {} 31 | 32 | public ObjectId getId() { 33 | return id; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonPojoIntId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | /** 19 | * @author Jon Brisbin 20 | */ 21 | public class PersonPojoIntId { 22 | 23 | private int id; 24 | private String text; 25 | 26 | public PersonPojoIntId(int id, String text) { 27 | this.id = id; 28 | this.text = text; 29 | } 30 | 31 | public int getId() { 32 | return id; 33 | } 34 | 35 | public String getText() { 36 | return text; 37 | } 38 | 39 | public void setText(String text) { 40 | this.text = text; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonPojoLongId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | /** 19 | * @author Jon Brisbin 20 | */ 21 | public class PersonPojoLongId { 22 | 23 | private long id; 24 | private String text; 25 | 26 | public PersonPojoLongId(long id, String text) { 27 | this.id = id; 28 | this.text = text; 29 | } 30 | 31 | public long getId() { 32 | return id; 33 | } 34 | 35 | public String getText() { 36 | return text; 37 | } 38 | 39 | public void setText(String text) { 40 | this.text = text; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonPojoStringId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | /** 19 | * @author Jon Brisbin 20 | */ 21 | public class PersonPojoStringId { 22 | 23 | private String id; 24 | private String text; 25 | 26 | public PersonPojoStringId(String id, String text) { 27 | this.id = id; 28 | this.text = text; 29 | } 30 | 31 | public String getId() { 32 | return id; 33 | } 34 | 35 | public String getText() { 36 | return text; 37 | } 38 | 39 | public void setText(String text) { 40 | this.text = text; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonSimpleList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import java.util.List; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | public class PersonSimpleList extends BasePerson { 24 | 25 | private List nicknames; 26 | 27 | public PersonSimpleList(Integer ssn, String firstName, String lastName) { 28 | super(ssn, firstName, lastName); 29 | } 30 | 31 | public List getNicknames() { 32 | return nicknames; 33 | } 34 | 35 | public void setNicknames(List nicknames) { 36 | this.nicknames = nicknames; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonWithDbRef.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | /** 19 | * @author Jon Brisbin 20 | */ 21 | public class PersonWithDbRef extends BasePerson { 22 | 23 | @DBRef private GeoLocation home; 24 | 25 | public PersonWithDbRef(Integer ssn, String firstName, String lastName, GeoLocation home) { 26 | super(ssn, firstName, lastName); 27 | this.home = home; 28 | } 29 | 30 | public GeoLocation getHome() { 31 | return home; 32 | } 33 | 34 | public void setHome(GeoLocation home) { 35 | this.home = home; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonWithLongDBRef.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.mapping; 2 | 3 | /** 4 | * @author Jon Brisbin 5 | */ 6 | public class PersonWithLongDBRef extends BasePerson { 7 | 8 | @DBRef private PersonPojoLongId personPojoLongId; 9 | 10 | public PersonWithLongDBRef(Integer ssn, String firstName, String lastName, PersonPojoLongId personPojoLongId) { 11 | super(ssn, firstName, lastName); 12 | this.personPojoLongId = personPojoLongId; 13 | } 14 | 15 | public PersonPojoLongId getPersonPojoLongId() { 16 | return personPojoLongId; 17 | } 18 | 19 | public void setPersonPojoLongId(PersonPojoLongId personPojoLongId) { 20 | this.personPojoLongId = personPojoLongId; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PersonWithObjectId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.bson.types.ObjectId; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | public class PersonWithObjectId extends BasePerson { 24 | 25 | private ObjectId id; 26 | 27 | public PersonWithObjectId(Integer ssn, String firstName, String lastName) { 28 | super(ssn, firstName, lastName); 29 | } 30 | 31 | public ObjectId getId() { 32 | return id; 33 | } 34 | 35 | public void setId(ObjectId id) { 36 | this.id = id; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/PrimitiveId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping; 17 | 18 | import org.springframework.data.annotation.Id; 19 | 20 | /** 21 | * @author Jon Brisbin 22 | */ 23 | @Document 24 | public class PrimitiveId { 25 | 26 | @Id int id; 27 | String text; 28 | 29 | public PrimitiveId(Integer id) { 30 | this.id = id; 31 | } 32 | 33 | public int getId() { 34 | return id; 35 | } 36 | 37 | public String getText() { 38 | return text; 39 | } 40 | 41 | public void setText(String text) { 42 | this.text = text; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/event/AfterSaveListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping.event; 17 | 18 | import java.util.ArrayList; 19 | 20 | import org.springframework.context.ApplicationEvent; 21 | import org.springframework.context.ApplicationListener; 22 | 23 | public class AfterSaveListener implements ApplicationListener> { 24 | 25 | public final ArrayList seenEvents = new ArrayList(); 26 | 27 | public void onApplicationEvent(AfterSaveEvent event) { 28 | this.seenEvents.add(event); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapping/event/PersonBeforeSaveListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.mapping.event; 17 | 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import org.springframework.context.ApplicationEvent; 22 | import org.springframework.data.mongodb.core.mapping.PersonPojoStringId; 23 | 24 | public class PersonBeforeSaveListener extends AbstractMongoEventListener { 25 | 26 | public final List seenEvents = new ArrayList(); 27 | 28 | @Override 29 | public void onBeforeSave(BeforeSaveEvent event) { 30 | seenEvents.add(event); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapreduce/NumberAndVersion.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.mapreduce; 2 | 3 | public class NumberAndVersion { 4 | 5 | private String id; 6 | private Long number; 7 | private Long version; 8 | private Long value; 9 | 10 | public Long getValue() { 11 | return value; 12 | } 13 | 14 | public void setValue(Long value) { 15 | this.value = value; 16 | } 17 | 18 | public String getId() { 19 | return id; 20 | } 21 | 22 | public void setId(String id) { 23 | this.id = id; 24 | } 25 | 26 | public Long getNumber() { 27 | return number; 28 | } 29 | 30 | public void setNumber(Long number) { 31 | this.number = number; 32 | } 33 | 34 | public Long getVersion() { 35 | return version; 36 | } 37 | 38 | public void setVersion(Long version) { 39 | this.version = version; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "NumberAndVersion [id=" + id + ", number=" + number + ", version=" + version + ", value=" + value + "]"; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/mapreduce/XObject.java: -------------------------------------------------------------------------------- 1 | package org.springframework.data.mongodb.core.mapreduce; 2 | 3 | public class XObject { 4 | 5 | private float x; 6 | 7 | private float count; 8 | 9 | public float getX() { 10 | return x; 11 | } 12 | 13 | public void setX(float x) { 14 | this.x = x; 15 | } 16 | 17 | public float getCount() { 18 | return count; 19 | } 20 | 21 | public void setCount(float count) { 22 | this.count = count; 23 | } 24 | 25 | @Override 26 | public String toString() { 27 | return "XObject [x=" + x + " count = " + count + "]"; 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/Contact.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2011-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | import org.bson.types.ObjectId; 19 | import org.springframework.data.annotation.Id; 20 | import org.springframework.data.mongodb.core.mapping.Document; 21 | 22 | /** 23 | * Sample contact domain class. 24 | * 25 | * @author Oliver Gierke 26 | */ 27 | @Document 28 | public abstract class Contact { 29 | 30 | @Id protected String id; 31 | 32 | public Contact() { 33 | this.id = new ObjectId().toString(); 34 | } 35 | 36 | public String getId() { 37 | return id; 38 | } 39 | 40 | public void setId(String id) { 41 | this.id = id; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ContactRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | /** 19 | * Simple repository interface managing {@link Contact}s. 20 | * 21 | * @author Oliver Gierke 22 | */ 23 | public interface ContactRepository extends MongoRepository { 24 | 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/Credentials.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | /** 19 | * @author Oliver Gierke 20 | */ 21 | public interface Credentials { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonExcerpt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | import org.springframework.beans.factory.annotation.Value; 19 | 20 | /** 21 | * @author Oliver Gierke 22 | */ 23 | public interface PersonExcerpt { 24 | 25 | @Value("#{target.firstname + ' ' + target.lastname}") 26 | String getFullName(); 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonRepositoryIntegrationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2010-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | import org.springframework.test.context.ContextConfiguration; 19 | 20 | /** 21 | * Integration test for {@link PersonRepository}. 22 | * 23 | * @author Oliver Gierke 24 | * @author Thomas Darimont 25 | */ 26 | @ContextConfiguration 27 | public class PersonRepositoryIntegrationTests extends AbstractPersonRepositoryIntegrationTests {} 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonSummary.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | /** 19 | * @author Oliver Gierke 20 | */ 21 | public interface PersonSummary { 22 | 23 | String getFirstname(); 24 | 25 | String getLastname(); 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/PersonSummaryWithOptional.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | import java.util.Optional; 19 | 20 | public interface PersonSummaryWithOptional { 21 | 22 | Optional
getAddress(); 23 | Optional getFirstname(); 24 | } 25 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/ReactivePersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.mongodb.repository; 18 | 19 | import reactor.core.publisher.Flux; 20 | 21 | /** 22 | * Sample reactive repository managing {@link Person} entities. 23 | * 24 | * @author Mark Paluch 25 | */ 26 | public interface ReactivePersonRepository extends ReactiveMongoRepository { 27 | 28 | /** 29 | * Returns all {@link Person}s with the given lastname. 30 | * 31 | * @param lastname 32 | * @return 33 | */ 34 | Flux findByLastname(String lastname); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/UsernameAndPassword.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository; 17 | 18 | /** 19 | * @author Oliver Gierke 20 | */ 21 | public class UsernameAndPassword implements Credentials { 22 | 23 | String username; 24 | String password; 25 | } 26 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/cdi/CdiPersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.cdi; 17 | 18 | import java.util.Optional; 19 | 20 | import org.springframework.data.mongodb.repository.Person; 21 | import org.springframework.data.repository.Repository; 22 | 23 | public interface CdiPersonRepository extends Repository { 24 | 25 | void deleteAll(); 26 | 27 | Person save(Person person); 28 | 29 | Optional findById(String id); 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/cdi/RepositoryClient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2012-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.cdi; 17 | 18 | import jakarta.inject.Inject; 19 | 20 | /** 21 | * @author Oliver Gierke 22 | * @author Mark Paluch 23 | */ 24 | class RepositoryClient { 25 | 26 | @Inject CdiPersonRepository repository; 27 | @Inject SamplePersonRepository samplePersonRepository; 28 | 29 | /** 30 | * @return the repository 31 | */ 32 | public CdiPersonRepository getRepository() { 33 | return repository; 34 | } 35 | 36 | public SamplePersonRepository getSamplePersonRepository() { 37 | return samplePersonRepository; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/cdi/SamplePersonFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | interface SamplePersonFragment { 22 | 23 | int returnOne(); 24 | } 25 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/cdi/SamplePersonFragmentImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.cdi; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | class SamplePersonFragmentImpl implements SamplePersonFragment { 22 | 23 | @Override 24 | public int returnOne() { 25 | return 1; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/cdi/SamplePersonRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2014-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.cdi; 17 | 18 | import org.springframework.data.mongodb.core.Person; 19 | import org.springframework.data.repository.Repository; 20 | 21 | /** 22 | * @author Mark Paluch 23 | */ 24 | public interface SamplePersonRepository extends Repository, SamplePersonFragment {} 25 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/config/lazy/ClassWithNestedRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.config.lazy; 17 | 18 | import org.springframework.data.mongodb.repository.MongoRepository; 19 | import org.springframework.data.mongodb.repository.User; 20 | 21 | /** 22 | * @author Thomas Darimont 23 | */ 24 | public class ClassWithNestedRepository { 25 | 26 | interface NestedUserRepository extends MongoRepository {} 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/ComposedRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | import org.springframework.data.mongodb.core.User; 19 | import org.springframework.data.repository.Repository; 20 | 21 | /** 22 | * @author Mark Paluch 23 | */ 24 | public interface ComposedRepository extends Repository, RepositoryMixin { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/CustomMongoRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | import java.util.List; 19 | 20 | import org.springframework.data.mongodb.repository.User; 21 | import org.springframework.data.repository.Repository; 22 | 23 | /** 24 | * @author Thomas Darimont 25 | */ 26 | public interface CustomMongoRepository extends Repository { 27 | 28 | List findByUsernameCustom(String username); 29 | } 30 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/CustomMongoRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2013-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | import java.util.Arrays; 19 | import java.util.List; 20 | 21 | import org.springframework.data.mongodb.repository.User; 22 | 23 | /** 24 | * @author Thomas Darimont 25 | */ 26 | public class CustomMongoRepositoryImpl implements CustomMongoRepository { 27 | 28 | @Override 29 | public List findByUsernameCustom(String username) { 30 | 31 | User user = new User(); 32 | user.setUsername(username); 33 | return Arrays.asList(user); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/CustomReactiveMongoRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | import org.springframework.data.mongodb.repository.User; 19 | import org.springframework.data.repository.reactive.RxJava3CrudRepository; 20 | 21 | /** 22 | * @author Mark Paluch 23 | */ 24 | public interface CustomReactiveMongoRepository 25 | extends RxJava3CrudRepository, CustomReactiveMongoRepositoryCustom { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/CustomReactiveMongoRepositoryCustom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.mongodb.repository.custom; 18 | 19 | import java.util.List; 20 | 21 | import org.springframework.data.mongodb.repository.User; 22 | 23 | /** 24 | * @author Mark Paluch 25 | */ 26 | public interface CustomReactiveMongoRepositoryCustom { 27 | 28 | List findByUsernameCustom(String username); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/CustomReactiveMongoRepositoryImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package org.springframework.data.mongodb.repository.custom; 18 | 19 | import java.util.Collections; 20 | import java.util.List; 21 | 22 | import org.springframework.data.mongodb.repository.User; 23 | 24 | /** 25 | * @author Mark Paluch 26 | */ 27 | public class CustomReactiveMongoRepositoryImpl implements CustomReactiveMongoRepositoryCustom { 28 | 29 | @Override 30 | public List findByUsernameCustom(String username) { 31 | 32 | User user = new User(); 33 | user.setUsername(username); 34 | 35 | return Collections.singletonList(user); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/RepositoryMixin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | public interface RepositoryMixin { 22 | 23 | String getFoo(); 24 | } 25 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/custom/RepositoryMixinImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.repository.custom; 17 | 18 | /** 19 | * @author Mark Paluch 20 | */ 21 | public class RepositoryMixinImpl implements RepositoryMixin { 22 | 23 | @Override 24 | public String getFoo() { 25 | return "foo"; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/BasicDbListBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2015-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.test.util; 17 | 18 | import com.mongodb.BasicDBList; 19 | 20 | /** 21 | * @author Christoph Strobl 22 | */ 23 | public class BasicDbListBuilder { 24 | 25 | private final BasicDBList dbl; 26 | 27 | public BasicDbListBuilder() { 28 | this.dbl = new BasicDBList(); 29 | } 30 | 31 | public BasicDbListBuilder add(Object value) { 32 | 33 | this.dbl.add(value); 34 | return this; 35 | } 36 | 37 | public BasicDBList get() { 38 | return this.dbl; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/ExcludeReactiveClientFromClassPath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.test.util; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author Christoph Strobl 26 | * @see ClassPathExclusions 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ ElementType.TYPE, ElementType.METHOD }) 30 | @Documented 31 | @ClassPathExclusions(packages = { "com.mongodb.reactivestreams.client" }) 32 | public @interface ExcludeReactiveClientFromClassPath { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/java/org/springframework/data/mongodb/test/util/ExcludeSyncClientFromClassPath.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.test.util; 17 | 18 | import java.lang.annotation.Documented; 19 | import java.lang.annotation.ElementType; 20 | import java.lang.annotation.Retention; 21 | import java.lang.annotation.RetentionPolicy; 22 | import java.lang.annotation.Target; 23 | 24 | /** 25 | * @author Christoph Strobl 26 | * @see ClassPathExclusions 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ ElementType.TYPE, ElementType.METHOD }) 30 | @Documented 31 | @ClassPathExclusions(packages = { "com.mongodb.client" }) 32 | public @interface ExcludeSyncClientFromClassPath { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/kotlin/org/springframework/data/mongodb/core/Entities.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | import org.springframework.data.annotation.Id 19 | import org.springframework.data.annotation.LastModifiedDate 20 | import org.springframework.data.annotation.Version 21 | import org.springframework.data.mongodb.core.mapping.Document 22 | import java.time.Instant 23 | 24 | @Document("versioned-auditable") 25 | data class KAuditableVersionedEntity( 26 | @Id val id: String?, 27 | val value: String, 28 | @Version val version: Long?, 29 | @LastModifiedDate val modificationDate: Instant? 30 | ) { 31 | fun withValue(value: String) = copy(value = value) 32 | } 33 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/kotlin/org/springframework/data/mongodb/core/ExecutableInsertOperationExtensionsTests.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | import example.first.First 19 | import io.mockk.mockk 20 | import io.mockk.verify 21 | import org.junit.Test 22 | 23 | /** 24 | * @author Sebastien Deleuze 25 | * @author Mark Paluch 26 | */ 27 | class ExecutableInsertOperationExtensionsTests { 28 | 29 | val operation = mockk(relaxed = true) 30 | 31 | @Test // DATAMONGO-1689 32 | fun `insert() with reified type parameter extension should call its Java counterpart`() { 33 | 34 | operation.insert() 35 | verify { operation.insert(First::class.java) } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/kotlin/org/springframework/data/mongodb/core/ExecutableRemoveOperationExtensionsTests.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core 17 | 18 | import example.first.First 19 | import io.mockk.mockk 20 | import io.mockk.verify 21 | import org.junit.Test 22 | 23 | /** 24 | * @author Sebastien Deleuze 25 | * @author Mark Paluch 26 | */ 27 | class ExecutableRemoveOperationExtensionsTests { 28 | 29 | val operation = mockk(relaxed = true) 30 | 31 | @Test // DATAMONGO-1689 32 | fun `remove() with reified type parameter extension should call its Java counterpart`() { 33 | 34 | operation.remove() 35 | verify { operation.remove(First::class.java) } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/kotlin/org/springframework/data/mongodb/core/convert/SpecialTransaction.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2024-2025 the original author or authors. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * https://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package org.springframework.data.mongodb.core.convert 17 | 18 | abstract class SomeTransaction() { 19 | 20 | abstract val id: String 21 | abstract val type: String 22 | } 23 | 24 | data class SpecialTransaction(override val id: String) : SomeTransaction() { 25 | override val type: String = "SOME_DEFAULT_VALUE" 26 | } 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/META-INF/mongo-named-queries.properties: -------------------------------------------------------------------------------- 1 | Person.findByNamedQuery={'firstname' : ?0} -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/geospatial.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/gridfs/another-resource.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/gridfs/gridfs.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/groupReduce.js: -------------------------------------------------------------------------------- 1 | function(doc, prev) { prev.count += 1 } -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/infrastructure.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/keyFunction.js: -------------------------------------------------------------------------------- 1 | function(doc) { return { x : doc.x }; } -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | %d %5p %40.40c:%4L - %m%n 7 | 8 | 9 | 10 | 11 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/logging.properties: -------------------------------------------------------------------------------- 1 | handlers = org.slf4j.bridge.SLF4JBridgeHandler -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/map.js: -------------------------------------------------------------------------------- 1 | function () { 2 | for (var i = 0; i < this.x.length; i++) { 3 | emit(this.x[i], 1); 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-custom-fieldnamingstrategy.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-custom-typeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-default.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-invalid.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-nested-bean-definition.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-validation-disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter-validation-enabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/converter.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/db-factory-bean-custom-write-concern.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/db-factory-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-client-uri-and-id.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-client-uri.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-uri-and-id.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-uri-no-credentials.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongo-uri-write-concern-and-details.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/namespace/mongoClient-bean.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/MongoBeanPropertyDocumentMapper-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/config/MongoDbFactoryNoDatabaseRunningTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/config/MongoNamespaceReplicaSetTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/config/auditing.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/config/mongo.properties: -------------------------------------------------------------------------------- 1 | mongo.host=127.0.0.1 2 | mongo.port=27017 3 | mongo.connectionsPerHost=8 4 | mongo.connectTimeout=1000 5 | mongo.maxWaitTime=1500 6 | mongo.autoConnectRetry=true 7 | mongo.socketTimeout=1500 8 | mongo.threadsAllowedToBlockForConnectionMultiplier=4 9 | mongo.socketKeepAlive=true 10 | mongo.fsync=true 11 | 12 | mongoSsl.ssl=true 13 | replicaSetName=rs0 14 | credential=jon:warg@snow?uri.authMechanism=PLAIN 15 | 16 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/core/index/MongoPersistentEntityIndexCreatorIntegrationTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/core/mapping/event/ValidatingMongoEventListenerTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/monitor/MongoMonitorIntegrationTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/repository/config/lazy/AllowNestedMongoRepositoriesRepositoryConfigTests-context.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 14 | 16 | 17 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/org/springframework/data/mongodb/repository/mongo.properties: -------------------------------------------------------------------------------- 1 | mongo.create-query-indexes=true 2 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/reactive-infrastructure.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/reduce.js: -------------------------------------------------------------------------------- 1 | function (key, values) { 2 | var sum = 0; 3 | for (var i = 0; i < values.length; i++) 4 | sum += values[i]; 5 | return sum; 6 | } -------------------------------------------------------------------------------- /spring-data-mongodb/src/test/resources/replicaSet.properties: -------------------------------------------------------------------------------- 1 | mongo.hosts=192.168.174.130:27017,192.168.174.130:27018,192.168.174.130:27019 -------------------------------------------------------------------------------- /src/main/antora/antora.yml: -------------------------------------------------------------------------------- 1 | name: data-mongodb 2 | version: true 3 | title: Spring Data MongoDB 4 | nav: 5 | - modules/ROOT/nav.adoc 6 | ext: 7 | collector: 8 | - run: 9 | command: ./mvnw validate process-resources -pl :spring-data-mongodb-distribution -am -Pantora-process-resources 10 | local: true 11 | scan: 12 | dir: spring-data-mongodb-distribution/target/classes/ 13 | - run: 14 | command: ./mvnw package -Pdistribute 15 | local: true 16 | scan: 17 | dir: target/antora 18 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/assets/images/jconsole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/spring-projects/spring-data-mongodb/4e53fa792e8582e19ea7498ee353a8bc0dbaa3a2/src/main/antora/modules/ROOT/assets/images/jconsole.png -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/examples/example: -------------------------------------------------------------------------------- 1 | ../../../../../../spring-data-mongodb/src/test/java/org/springframework/data/mongodb/example -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/commons/upgrade.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$upgrade.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/coroutines.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/coroutines.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/null-safety.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/null-safety.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/kotlin/requirements.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$kotlin/requirements.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/migration-guide/migration-guide-3.x-to-4.x.adoc: -------------------------------------------------------------------------------- 1 | [[mongodb.migration.3.x-4.x]] 2 | = Migration Guide from 3.x to 4.x 3 | 4 | Spring Data MongoDB 4.x requires the MongoDB Java Driver 4.8.x + 5 | To learn more about driver versions please visit the https://www.mongodb.com/docs/drivers/java/sync/current/upgrade/[MongoDB Documentation]. 6 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/migration-guides.adoc: -------------------------------------------------------------------------------- 1 | [[mongodb.migration]] 2 | = Migration Guides 3 | :page-section-summary-toc: 1 4 | 5 | This section contains version-specific migration guides explaining how to upgrade between two versions. 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/mongodb/mongo-server-side-scripts.adoc: -------------------------------------------------------------------------------- 1 | [[mongo.server-side-scripts]] 2 | = Script Operations 3 | 4 | [WARNING] 5 | ==== 6 | https://docs.mongodb.com/master/release-notes/4.2-compatibility/[MongoDB 4.2] removed support for the `eval` command used 7 | by `ScriptOperations`. + 8 | There is no replacement for the removed functionality. 9 | ==== 10 | 11 | MongoDB allows running JavaScript functions on the server by either directly sending the script or calling a stored one. `ScriptOperations` can be accessed through `MongoTemplate` and provides basic abstraction for `JavaScript` usage. The following example shows how to us the `ScriptOperations` class: 12 | 13 | ==== 14 | [source,java] 15 | ---- 16 | ScriptOperations scriptOps = template.scriptOps(); 17 | 18 | ExecutableMongoScript echoScript = new ExecutableMongoScript("function(x) { return x; }"); 19 | scriptOps.execute(echoScript, "directly execute script"); <1> 20 | 21 | scriptOps.register(new NamedMongoScript("echo", echoScript)); <2> 22 | scriptOps.call("echo", "execute script via name"); <3> 23 | ---- 24 | <1> Run the script directly without storing the function on server side. 25 | <2> Store the script using 'echo' as its name. The given name identifies the script and allows calling it later. 26 | <3> Run the script with name 'echo' using the provided parameters. 27 | ==== 28 | 29 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/mongodb/repositories/vector-search.adoc: -------------------------------------------------------------------------------- 1 | :vector-search-intro-include: partial$vector-search-intro-include.adoc 2 | :vector-search-model-include: partial$vector-search-model-include.adoc 3 | :vector-search-repository-include: partial$vector-search-repository-include.adoc 4 | :vector-search-scoring-include: partial$vector-search-scoring-include.adoc 5 | :vector-search-method-derived-include: partial$vector-search-method-derived-include.adoc 6 | :vector-search-method-annotated-include: partial$vector-search-method-annotated-include.adoc 7 | 8 | include::partial$/vector-search.adoc[] 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/mongodb/value-expressions.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$value-expressions.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/observability/conventions.adoc: -------------------------------------------------------------------------------- 1 | [[observability-conventions]] 2 | = Conventions 3 | 4 | Below you can find a list of all `GlobalObservationConvention` and `ObservationConvention` declared by this project. 5 | 6 | .ObservationConvention implementations 7 | |=== 8 | |ObservationConvention Class Name | Applicable ObservationContext Class Name 9 | |`org.springframework.data.mongodb.observability.DefaultMongoHandlerObservationConvention`|`MongoHandlerContext` 10 | |`org.springframework.data.mongodb.observability.MongoHandlerObservationConvention`|`MongoHandlerContext` 11 | |=== 12 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/observability/spans.adoc: -------------------------------------------------------------------------------- 1 | [[observability-spans]] 2 | = Spans 3 | 4 | Below you can find a list of all spans declared by this project. 5 | 6 | [[observability-spans-mongodb-command-observation]] 7 | == Mongodb Command Observation Span 8 | 9 | > Timer created around a MongoDB command execution. 10 | 11 | **Span name** `spring.data.mongodb.command`. 12 | 13 | Fully qualified name of the enclosing class `org.springframework.data.mongodb.observability.MongoObservation`. 14 | 15 | .Tag Keys 16 | |=== 17 | |Name | Description 18 | |`db.connection_string` _(required)_|MongoDB connection string. 19 | |`db.mongodb.collection` _(required)_|MongoDB collection name. 20 | |`db.name` _(required)_|MongoDB database name. 21 | |`db.operation` _(required)_|MongoDB command value. 22 | |`db.system` _(required)_|MongoDB database system. 23 | |`db.user` _(required)_|MongoDB user. 24 | |`net.peer.name` _(required)_|Name of the database host. 25 | |`net.peer.port` _(required)_|Logical remote port number. 26 | |`net.sock.peer.addr` _(required)_|Mongo peer address. 27 | |`net.sock.peer.port` _(required)_|Mongo peer port. 28 | |`net.transport` _(required)_|Network transport. 29 | |`spring.data.mongodb.cluster_id` _(required)_|MongoDB cluster identifier. 30 | |=== 31 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories.adoc: -------------------------------------------------------------------------------- 1 | [[mongodb.repositories]] 2 | = Repositories 3 | :page-section-summary-toc: 1 4 | 5 | This chapter explains the basic foundations of Spring Data repositories and MongoDB specifics. 6 | Before continuing to the MongoDB specifics, make sure you have a sound understanding of the basic concepts. 7 | 8 | The goal of the Spring Data repository abstraction is to significantly reduce the amount of boilerplate code required to implement data access layers for various persistence stores. 9 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/core-concepts.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/core-concepts.adoc[] 2 | 3 | [[mongodb.entity-persistence.state-detection-strategies]] 4 | include::{commons}@data-commons::page$is-new-state-detection.adoc[leveloffset=+1] 5 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/core-domain-events.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/core-domain-events.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/create-instances.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/create-instances.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/custom-implementations.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/custom-implementations.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/definition.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/definition.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/null-handling.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/null-handling.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/projections.adoc: -------------------------------------------------------------------------------- 1 | [[mongodb.projections]] 2 | include::{commons}@data-commons::page$repositories/projections.adoc[] 3 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-by-example.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::query-by-example.adoc[] 2 | 3 | [[query-by-example.running]] 4 | == Running an Example 5 | 6 | The following example shows how to query by example when using a repository (of `Person` objects, in this case): 7 | 8 | .Query by Example using a repository 9 | ==== 10 | [source, java] 11 | ---- 12 | public interface PersonRepository extends QueryByExampleExecutor { 13 | 14 | } 15 | 16 | public class PersonService { 17 | 18 | @Autowired PersonRepository personRepository; 19 | 20 | public List findPeople(Person probe) { 21 | return personRepository.findAll(Example.of(probe)); 22 | } 23 | } 24 | ---- 25 | ==== 26 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-keywords-reference.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/query-keywords-reference.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-methods-details.adoc: -------------------------------------------------------------------------------- 1 | :feature-scroll: 2 | include::{commons}@data-commons::page$repositories/query-methods-details.adoc[] 3 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/pages/repositories/query-return-types-reference.adoc: -------------------------------------------------------------------------------- 1 | include::{commons}@data-commons::page$repositories/query-return-types-reference.adoc[] 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-intro-include.adoc: -------------------------------------------------------------------------------- 1 | To use Vector Search with MongoDB, you need a MongoDB Atlas instance that is either running in the cloud or by using https://www.mongodb.com/docs/atlas/cli/current/atlas-cli-deploy-docker/[Docker]. 2 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-method-annotated-include.adoc: -------------------------------------------------------------------------------- 1 | Annotated search methods use the `@VectorSearch` annotation to define parameters for the https://www.mongodb.com/docs/upcoming/reference/operator/aggregation/vectorSearch/[`$vectorSearch`] aggregation stage. 2 | 3 | .Using `@VectorSearch` Search Methods 4 | ==== 5 | [source,java] 6 | ---- 7 | interface CommentRepository extends Repository { 8 | 9 | @VectorSearch(indexName = "cos-index", filter = "{country: ?0}", limit="100", numCandidates="2000") 10 | SearchResults searchAnnotatedByCountryAndEmbeddingWithin(String country, Vector embedding, 11 | Score distance); 12 | 13 | @VectorSearch(indexName = "my-index", filter = "{country: ?0}", limit="?3", numCandidates = "#{#limit * 20}", 14 | searchType = VectorSearchOperation.SearchType.ANN) 15 | List findAnnotatedByCountryAndEmbeddingWithin(String country, Vector embedding, Score distance, int limit); 16 | } 17 | ---- 18 | ==== 19 | 20 | Annotated Search Methods can define `filter` for pre-filter usage. 21 | 22 | `filter`, `limit`, and `numCandidates` support xref:page$mongodb/value-expressions.adoc[Value Expressions] allowing references to search method arguments. 23 | 24 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-method-derived-include.adoc: -------------------------------------------------------------------------------- 1 | MongoDB Search methods must use the `@VectorSearch` annotation to define the index name for the https://www.mongodb.com/docs/upcoming/reference/operator/aggregation/vectorSearch/[`$vectorSearch`] aggregation stage. 2 | 3 | .Using `Near` and `Within` Keywords in Repository Search Methods 4 | ==== 5 | [source,java] 6 | ---- 7 | interface CommentRepository extends Repository { 8 | 9 | @VectorSearch(indexName = "my-index", numCandidates="200") 10 | SearchResults searchTop10ByEmbeddingNear(Vector vector, Score score); 11 | 12 | @VectorSearch(indexName = "my-index", numCandidates="200") 13 | SearchResults searchTop10ByEmbeddingWithin(Vector vector, Range range); 14 | 15 | @VectorSearch(indexName = "my-index", numCandidates="200") 16 | SearchResults searchTop10ByCountryAndEmbeddingWithin(String country, Vector vector, Range range); 17 | } 18 | ---- 19 | ==== 20 | 21 | Derived Search Methods can define domain model attributes to create the pre-filter for indexed fields. 22 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-model-include.adoc: -------------------------------------------------------------------------------- 1 | ==== 2 | [source,java] 3 | ---- 4 | class Comment { 5 | 6 | @Id String id; 7 | String country; 8 | String comment; 9 | 10 | Vector embedding; 11 | 12 | // getters, setters, … 13 | } 14 | ---- 15 | ==== 16 | -------------------------------------------------------------------------------- /src/main/antora/modules/ROOT/partials/vector-search-repository-include.adoc: -------------------------------------------------------------------------------- 1 | .Using `SearchResult` in a Repository Search Method 2 | ==== 3 | [source,java] 4 | ---- 5 | interface CommentRepository extends Repository { 6 | 7 | @VectorSearch(indexName = "my-index", numCandidates="#{#limit.max() * 20}") 8 | SearchResults searchByCountryAndEmbeddingNear(String country, Vector vector, Score score, 9 | Limit limit); 10 | 11 | @VectorSearch(indexName = "my-index", limit="10", numCandidates="200") 12 | SearchResults searchByCountryAndEmbeddingWithin(String country, Vector embedding, 13 | Score score); 14 | 15 | } 16 | 17 | SearchResults results = repository.searchByCountryAndEmbeddingNear("en", Vector.of(…), Score.of(0.9), Limit.of(10)); 18 | ---- 19 | ==== 20 | 21 | [TIP] 22 | ==== 23 | The MongoDB https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-stage/[vector search aggregation] stage defines a set of required arguments and restrictions. 24 | Please make sure to follow the guidelines and make sure to provide required arguments like `limit`. 25 | ==== 26 | -------------------------------------------------------------------------------- /src/main/antora/resources/antora-resources/antora.yml: -------------------------------------------------------------------------------- 1 | version: ${antora-component.version} 2 | prerelease: ${antora-component.prerelease} 3 | 4 | asciidoc: 5 | attributes: 6 | version: ${project.version} 7 | copyright-year: ${current.year} 8 | springversionshort: ${spring.short} 9 | springversion: ${spring} 10 | attribute-missing: 'warn' 11 | commons: ${springdata.commons.docs} 12 | include-xml-namespaces: false 13 | spring-data-commons-docs-url: https://docs.spring.io/spring-data/commons/reference 14 | spring-data-commons-javadoc-base: https://docs.spring.io/spring-data/commons/docs/${springdata.commons}/api/ 15 | springdocsurl: https://docs.spring.io/spring-framework/reference/{springversionshort} 16 | springjavadocurl: https://docs.spring.io/spring-framework/docs/${spring}/javadoc-api 17 | spring-framework-docs: '{springdocsurl}' 18 | spring-framework-javadoc: '{springjavadocurl}' 19 | springhateoasversion: ${spring-hateoas} 20 | releasetrainversion: ${releasetrain} 21 | reactor: ${reactor} 22 | mongoversion: ${mongo} 23 | store: Mongo 24 | -------------------------------------------------------------------------------- /src/main/resources/notice.txt: -------------------------------------------------------------------------------- 1 | Spring Data MongoDB 5.0 M3 (2025.1.0) 2 | Copyright (c) [2010-2019] Pivotal Software, Inc. 3 | 4 | This product is licensed to you under the Apache License, Version 2.0 (the "License"). 5 | You may not use this product except in compliance with the License. 6 | 7 | This product may include a number of subcomponents with 8 | separate copyright notices and license terms. Your use of the source 9 | code for the these subcomponents is subject to the terms and 10 | conditions of the subcomponent's license, as noted in the LICENSE file. 11 | 12 | --------------------------------------------------------------------------------