100+ results for 'mongodb lang:java'

Not the results you expected?

RepositoryService.java (https://github.com/lightningdb/chililog-server.git) Java · 362 lines

30 import org.chililog.server.data.RepositoryConfigBO.Status;

31

32 import com.mongodb.DB;

33

34 /**

46 *

47 * <p>

48 * It is assumed that mongoDB and HornetQ (via {@link MqService}) has been started.

49 * </p>

50 *

MongoDbMessageStoreClaimCheckIntegrationTests.java (https://github.com/artembilan/spring-integration.git) Java · 202 lines

26

27 import org.springframework.context.support.GenericApplicationContext;

28 import org.springframework.integration.mongodb.rules.MongoDbAvailable;

29 import org.springframework.integration.mongodb.rules.MongoDbAvailableTests;

38 * @author Artem Bilan

39 */

40 public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvailableTests {

41

42 private final GenericApplicationContext testApplicationContext = TestUtils.createTestApplicationContext();

55 @MongoDbAvailable

56 public void stringPayload() {

57 MongoDbMessageStore messageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);

58 messageStore.afterPropertiesSet();

59 ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);

71 @MongoDbAvailable

72 public void objectPayload() {

73 MongoDbMessageStore messageStore = new MongoDbMessageStore(MONGO_DATABASE_FACTORY);

74 messageStore.afterPropertiesSet();

75 ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);

UnwrappedMongoPersistentProperty.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 368 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.mapping;

17

18 import java.lang.annotation.Annotation;

ClusterDescription.java (git://github.com/mongodb/mongo-java-driver.git) Java · 336 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.MongoException;

20 import com.mongodb.ReadPreference;

21 import com.mongodb.annotations.Immutable;

22 import com.mongodb.internal.selector.ReadPreferenceServerSelector;

23 import com.mongodb.internal.selector.WritableServerSelector;

QueryBuilder.java (https://github.com/iliasbartolini/mongo-java-driver.git) Java · 323 lines

17 */

18

19 package com.mongodb;

20

21 import java.util.ArrayList;

47 /**

48 * Creates a new query with a document key

49 * @param key MongoDB document key

50 * @return Returns a new QueryBuilder

51 */

57 * Adds a new key to the query if not present yet.

58 * Sets this key as the current key.

59 * @param key MongoDB document key

60 * @return Returns the current QueryBuilder

61 */

FindIterableImpl.java (git://github.com/mongodb/mongo-java-driver.git) Java · 216 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.client.FindIterable;

20 import com.mongodb.client.MongoCursor;

21 import com.mongodb.client.MongoIterable;

22 import com.mongodb.client.model.Collation;

23 import com.mongodb.client.model.FindOptions;

MongoDbOutboundGatewayXmlTests.java (https://github.com/artembilan/spring-integration.git) Java · 187 lines

28 import org.springframework.beans.factory.annotation.Autowired;

29 import org.springframework.context.ApplicationContext;

30 import org.springframework.data.mongodb.MongoDatabaseFactory;

31 import org.springframework.data.mongodb.core.MongoTemplate;

32 import org.springframework.integration.endpoint.EventDrivenConsumer;

33 import org.springframework.integration.mongodb.rules.MongoDbAvailable;

34 import org.springframework.integration.mongodb.rules.MongoDbAvailableTests;

47 @RunWith(SpringRunner.class)

48 @DirtiesContext

49 public class MongoDbOutboundGatewayXmlTests extends MongoDbAvailableTests {

50

51 private static final String COLLECTION_NAME = "data";

67 @After

68 public void cleanUp() {

69 MongoDatabaseFactory mongoDbFactory = this.prepareMongoFactory();

70 MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory);

WebGalleryAdapter.java (https://github.com/shangrz/FlipDroid.git) Java · 179 lines

51 * the current context

52 * @param imageUrls

53 * the set of it.tika.mongodb.image URLs which are to be loaded and displayed

54 */

55 public WebGalleryAdapter(Context context, List<String> imageUrls) {

61 * the current context

62 * @param imageUrls

63 * the set of it.tika.mongodb.image URLs which are to be loaded and displayed

64 * @param progressDrawableResId

65 * the resource ID of the drawable that will be used for rendering progress

74 * the current context

75 * @param imageUrls

76 * the set of it.tika.mongodb.image URLs which are to be loaded and displayed

77 * @param progressDrawableResId

78 * the resource ID of the drawable that will be used for rendering progress

DefaultDBCallback.java (https://github.com/iliasbartolini/mongo-java-driver.git) Java · 143 lines

17 */

18

19 package com.mongodb;

20

21 // Bson

MongoDbComponentAutoConfiguration.java (https://gitlab.com/matticala/apache-camel) Java · 128 lines

15 * limitations under the License.

16 */

17 package org.apache.camel.component.mongodb.springboot;

18

19 import java.util.HashMap;

22 import javax.annotation.Generated;

23 import org.apache.camel.CamelContext;

24 import org.apache.camel.component.mongodb.MongoDbComponent;

25 import org.apache.camel.spi.ComponentCustomizer;

26 import org.apache.camel.spi.HasId;

57 MongoDbComponentConfiguration.class})

58 public class MongoDbComponentAutoConfiguration {

59

60 private static final Logger LOGGER = LoggerFactory

79 @ConditionalOnMissingBean(MongoDbComponent.class)

80 public MongoDbComponent configureMongoDbComponent() throws Exception {

81 MongoDbComponent component = new MongoDbComponent();

ModelFactory.java (https://gitlab.com/datainmotion_opensource/emf-mongo) Java · 239 lines

3 package org.eclipselabs.emf.mongo.model;

4

5 import com.mongodb.client.MongoCollection;

6 import com.mongodb.client.MongoCursor;

MongoDbMessageStoreClaimCheckIntegrationTests.java (https://github.com/azeller/spring-integration.git) Java · 149 lines

21 import org.springframework.data.mongodb.core.SimpleMongoDbFactory;

22 import org.springframework.integration.Message;

23 import org.springframework.integration.mongodb.rules.MongoDbAvailable;

24 import org.springframework.integration.mongodb.rules.MongoDbAvailableTests;

34 * @author Mark Fisher

35 */

36 public class MongoDbMessageStoreClaimCheckIntegrationTests extends MongoDbAvailableTests{

37

38 @Test

39 @MongoDbAvailable

40 public void stringPayload() throws Exception {

41 MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");

42 MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);

60 MongoDbFactory mongoDbFactory = new SimpleMongoDbFactory(new Mongo(), "test");

61 MongoDbMessageStore messageStore = new MongoDbMessageStore(mongoDbFactory);

62 ClaimCheckInTransformer checkin = new ClaimCheckInTransformer(messageStore);

63 ClaimCheckOutTransformer checkout = new ClaimCheckOutTransformer(messageStore);

TestCase.java (git://github.com/mongodb/mongo-java-driver.git) Java · 278 lines ✨ Summary

This Java code is a test framework for MongoDB, allowing users to write unit tests for their classes. It scans for test classes in a specified directory, runs each test method, and reports the results, including any errors or failures. The output includes a summary of the number of passed and failed tests, as well as detailed error messages.

17 */

18

19 package com.mongodb.util;

20

21 import java.io.BufferedReader;

27 import java.util.List;

28

29 import com.mongodb.Mongo;

30

31 public class TestCase extends MyAsserts {

211 }

212

213 if ( ste.getClassName().equals( "com.mongodb.util.TestCase" ) &&

214 ste.getMethodName().equals( "run" ) )

215 foundMe = true;

ServerVersionHelper.java (https://github.com/jyemin/mongo-java-driver.git) Java · 99 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.operation;

18

19

20 import com.mongodb.connection.ConnectionDescription;

21

22 /**

BulkOperations.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 166 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.util.List;

19

20 import org.springframework.data.mongodb.core.query.Query;

21 import org.springframework.data.mongodb.core.query.Update;

22 import org.springframework.data.util.Pair;

23

24 import com.mongodb.bulk.BulkWriteResult;

25

26 /**

27 * Bulk operations for insert/update/remove actions on a collection. These bulks operation are available since MongoDB

28 * 2.6 and make use of low level bulk commands on the protocol level. This interface defines a fluent API to add

29 * multiple single operations or list of similar operations in sequence which can then eventually be executed by calling

FcmSendMessageRequest.java (https://github.com/mongodb/stitch-android-sdk.git) Java · 248 lines

1 /*

2 * Copyright 2018-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.stitch.core.services.fcm;

18

19 import javax.annotation.Nonnull;

CopySink.java (git://github.com/WindowsAzure/azure-sdk-for-java.git) Java · 280 lines

60 @JsonSubTypes.Type(name = "SalesforceSink", value = SalesforceSink.class),

61 @JsonSubTypes.Type(name = "SalesforceServiceCloudSink", value = SalesforceServiceCloudSink.class),

62 @JsonSubTypes.Type(name = "MongoDbAtlasSink", value = MongoDbAtlasSink.class),

63 @JsonSubTypes.Type(name = "MongoDbV2Sink", value = MongoDbV2Sink.class),

64 @JsonSubTypes.Type(name = "CosmosDbMongoDbApiSink", value = CosmosDbMongoDbApiSink.class)

65 })

66 @Fluent

OptionsSupportTest.java (https://github.com/sears/YCSB.git) Java · 184 lines

34 /**

35 * Test method for {@link OptionsSupport#updateUrl(String, Properties)} for

36 * {@code mongodb.maxconnections}.

37 */

38 @Test

39 public void testUpdateUrlMaxConnections() {

40 assertThat(

41 updateUrl("mongodb://locahost:27017/",

42 props("mongodb.maxconnections", "1234")),

43 is("mongodb://locahost:27017/?maxPoolSize=1234"));

44 assertThat(

45 updateUrl("mongodb://locahost:27017/?foo=bar",

46 props("mongodb.maxconnections", "1234")),

47 is("mongodb://locahost:27017/?foo=bar&maxPoolSize=1234"));

MongoConnectionImpl.java (git://github.com/suguru/mongo-java-async-driver.git) Java · 303 lines

22

23 /**

24 * MongoDB との非同期通信を行うクライアント

25 *

26 * @author suguru

55

56 /**

57 * MongoDB へ接続します。

58 */

59 public void open() {

64 }

65 if (!future.isSuccess()) {

66 throw new MongoException("No available MongoDB servers.");

67 }

68 }

CollationUtils.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 112 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.repository.query;

17

18 import java.util.Locale;

21

22 import org.bson.Document;

23 import org.springframework.data.mongodb.core.query.Collation;

24 import org.springframework.data.mongodb.util.json.ParameterBindingContext;

25 import org.springframework.data.mongodb.util.json.ParameterBindingDocumentCodec;

26 import org.springframework.data.repository.query.QueryMethodEvaluationContextProvider;

27 import org.springframework.expression.ExpressionParser;

OperationIterable.java (https://github.com/d5nguyenvan/mongo-java-driver.git) Java · 158 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.async.client;

18

19 import com.mongodb.Block;

20 import com.mongodb.Function;

21 import com.mongodb.ReadPreference;

22 import com.mongodb.async.AsyncBatchCursor;

23 import com.mongodb.async.SingleResultCallback;

MongoFixture.java (https://github.com/jyemin/mongo-java-driver.git) Java · 221 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.reactivestreams.client;

18

19 import com.mongodb.ClusterFixture;

20 import com.mongodb.MongoClientSettings;

21 import com.mongodb.MongoCommandException;

22 import com.mongodb.MongoException;

23 import com.mongodb.MongoNamespace;

FullDocumentBeforeChange.java (https://github.com/jyemin/mongo-java-driver.git) Java · 84 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.model.changestream;

18

19 import static com.mongodb.assertions.Assertions.assertNotNull;

28 *

29 * @since 4.7

30 * @mongodb.server.release 6.0

31 */

32 public enum FullDocumentBeforeChange {

ConnectionEventMulticaster.java (https://github.com/foursquare/mongo-java-driver.git) Java · 78 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.event;

18

19 import com.mongodb.annotations.Beta;

JsonSubTypePropertyDefaultValueTest.java (https://github.com/Graylog2/graylog2-server.git) Java · 108 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog2.jackson;

BsonArray.java (https://github.com/jyemin/mongo-java-driver.git) Java · 267 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

75

76 /**

77 * Parses a string in MongoDB Extended JSON format to a {@code BsonArray}

78 *

79 * @param json the JSON string

80 * @return a corresponding {@code BsonArray} object

81 * @see org.bson.json.JsonReader

82 * @mongodb.driver.manual reference/mongodb-extended-json/ MongoDB Extended JSON

83 *

84 * @since 3.4

ByteBufBsonDocument.java (https://github.com/jyemin/mongo-java-driver.git) Java · 173 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.connection;

18

19 import org.bson.BsonBinaryReader;

MongoNamespace.java (https://github.com/jyemin/mongo-java-driver.git) Java · 200 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.annotations.Immutable;

25 import java.util.Set;

26

27 import static com.mongodb.assertions.Assertions.isTrueArgument;

28 import static com.mongodb.assertions.Assertions.notNull;

30

31 /**

32 * A MongoDB namespace, which includes a database name and collection name.

33 *

34 * @since 3.0

ClientSessionBinding.java (https://github.com/mongodb/mongo-java-driver.git) Java · 229 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.async.client;

18

19 import com.mongodb.ReadConcern;

20 import com.mongodb.ReadPreference;

21 import com.mongodb.async.SingleResultCallback;

22 import com.mongodb.binding.AsyncClusterBinding;

23 import com.mongodb.binding.AsyncConnectionSource;

ESValuesHandler.java (https://github.com/Graylog2/graylog2-server.git) Java · 91 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog.storage.elasticsearch7.views.searchtypes.pivot.buckets;

ClassModel.java (git://github.com/mongodb/mongo-java-driver.git) Java · 232 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

MongoNestedAttributeExpressionFactory.java (https://github.com/geotools/geotools.git) Java · 160 lines

15 * Lesser General Public License for more details.

16 */

17 package org.geotools.data.mongodb.complex;

18

19 import java.io.IOException;

26 import org.geotools.data.complex.spi.CustomAttributeExpressionFactory;

27 import org.geotools.data.complex.util.XPathUtil;

28 import org.geotools.data.mongodb.MongoFeatureStore;

29 import org.geotools.feature.type.Types;

30 import org.geotools.filter.ConstantExpression;

32 import org.opengis.filter.expression.Expression;

33

34 /** Custom nested attribute expressions builder for MongoDB. */

35 public class MongoNestedAttributeExpressionFactory implements CustomAttributeExpressionFactory {

36

GridFSDBFile.java (https://github.com/jyemin/mongo-java-driver.git) Java · 202 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.gridfs;

18

19 import com.mongodb.BasicDBObject;

20 import com.mongodb.DBObject;

21 import com.mongodb.MongoException;

34 * </ul>

35 *

36 * @mongodb.driver.manual core/gridfs/ GridFS

37 */

38 public class GridFSDBFile extends GridFSFile {

GridFSDBFile.java (https://github.com/foursquare/mongo-java-driver.git) Java · 202 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.gridfs;

18

19 import com.mongodb.BasicDBObject;

20 import com.mongodb.DBObject;

21 import com.mongodb.MongoException;

34 * </ul>

35 *

36 * @mongodb.driver.manual core/gridfs/ GridFS

37 */

38 public class GridFSDBFile extends GridFSFile {

PersonService.java (https://bitbucket.org/akshayk1987/javaexamples.git) Java · 226 lines

5 import java.util.UUID;

6

7 import mongo.MongoDBFactory;

8

9 import org.apache.log4j.Logger;

11 import org.springframework.transaction.annotation.Transactional;

12

13 import com.mongodb.BasicDBObject;

14 import com.mongodb.DBCollection;

15 import com.mongodb.DBCursor;

16 import com.mongodb.DBObject;

36

37 // Retrieve collection

38 DBCollection coll = MongoDBFactory.getCollection("mydb","mycollection");

39 // Retrieve cursor for iterating records

40 DBCursor cur = coll.find();

MongoConnection.java (https://github.com/meddah/graylog2-server.git) Java · 186 lines

21 package org.graylog2.database;

22

23 import com.mongodb.*;

24

25 import java.util.List;

28 * MongoConnection.java: Jun 6, 2010 1:36:19 PM

29 *

30 * MongoDB connection singleton

31 *

32 * @author: Lennart Koopmann <lennart@socketfeed.com>

59 * Connect the instance.

60 *

61 * @param username MongoDB user

62 * @param password MongoDB password

63 * @param hostname MongoDB host

64 * @param database MongoDB database

SpringTODOController.java (https://github.com/kachhalimbu/springzktodo.git) Java · 84 lines

2 *

3 */

4 package org.zkoss.mongodb.sample.controller;

5

6 import java.text.SimpleDateFormat;

10

11 import org.springframework.context.annotation.Scope;

12 import org.zkoss.mongodb.sample.model.Task;

13 import org.zkoss.mongodb.sample.service.TaskService;

SyncConnection.java (https://github.com/jyemin/mongo-java-driver.git) Java · 141 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.client.syncadapter;

17

18 import com.mongodb.MongoNamespace;

19 import com.mongodb.ReadPreference;

20 import com.mongodb.RequestContext;

21 import com.mongodb.ServerApi;

22 import com.mongodb.WriteConcernResult;

PaymentReconciliation.java (https://bitbucket.org/piyushgd10/bhumi.git) Java · 286 lines

5

6 import org.springframework.data.annotation.Id;

7 import org.springframework.data.mongodb.core.mapping.Document;

8

9 /**

ServerSettings.java (https://github.com/foursquare/mongo-java-driver.git) Java · 232 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.ConnectionString;

20 import com.mongodb.annotations.Immutable;

21 import com.mongodb.annotations.NotThreadSafe;

22 import com.mongodb.event.ServerListener;

23 import com.mongodb.event.ServerMonitorListener;

WordDao.java (https://github.com/beldenge/SentenceBuilder.git) Java · 211 lines

20 package com.ciphertool.sentencebuilder.dao;

21

22 import static org.springframework.data.mongodb.core.aggregation.Aggregation.group;

23 import static org.springframework.data.mongodb.core.aggregation.Aggregation.limit;

24 import static org.springframework.data.mongodb.core.aggregation.Aggregation.sort;

25

26 import java.util.ArrayList;

33 import org.springframework.beans.factory.annotation.Required;

34 import org.springframework.data.domain.Sort;

35 import org.springframework.data.mongodb.core.MongoOperations;

36 import org.springframework.data.mongodb.core.aggregation.Aggregation;

37 import org.springframework.data.mongodb.core.aggregation.AggregationResults;

38 import org.springframework.data.mongodb.core.query.Criteria;

SyncFindIterable.java (https://github.com/jyemin/mongo-java-driver.git) Java · 202 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.reactivestreams.client.syncadapter;

18

19 import com.mongodb.CursorType;

20 import com.mongodb.ExplainVerbosity;

21 import com.mongodb.client.FindIterable;

22 import com.mongodb.client.model.Collation;

23 import com.mongodb.lang.Nullable;

LatencyMinimizingServerSelectorTest.java (https://github.com/jyemin/mongo-java-driver.git) Java · 91 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.selector;

18

19 import com.mongodb.ServerAddress;

20 import com.mongodb.connection.ClusterDescription;

21 import com.mongodb.connection.ServerDescription;

22 import com.mongodb.connection.ServerType;

23 import org.junit.Test;

24

AbstractConstructibleBsonElementTest.java (https://github.com/jyemin/mongo-java-driver.git) Java · 125 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal.client.model;

17

18 import org.bson.BsonDocument;

AntPath.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 105 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.gridfs;

17

18 import java.util.regex.Matcher;

MatchOperation.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 81 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.aggregation;

17

18 import org.bson.Document;

19

20 import org.springframework.data.mongodb.core.query.CriteriaDefinition;

21 import org.springframework.util.Assert;

22

33 * @author Divya Srivastava

34 * @since 1.3

35 * @see <a href="https://docs.mongodb.com/manual/reference/operator/aggregation/match/">MongoDB Aggregation Framework:

36 * $match</a>

37 */

ReactiveInsertOperationSupport.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 90 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import reactor.core.publisher.Flux;

MongoServerApiFactoryBean.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 92 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import org.springframework.beans.factory.FactoryBean;

20 import org.springframework.util.ObjectUtils;

21

22 import com.mongodb.ServerApi;

23 import com.mongodb.ServerApi.Builder;

24 import com.mongodb.ServerApiVersion;

25

26 /**

DecoderBench.java (git://github.com/bguerout/jongo.git) Java · 79 lines

19 import com.google.caliper.Runner;

20 import com.google.caliper.SimpleBenchmark;

21 import com.mongodb.*;

22 import org.jongo.bson.Bson;

23 import org.jongo.bson.BsonDBDecoder;

ExecutableInsertOperationSupport.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 139 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.util.ArrayList;

19 import java.util.Collection;

20

21 import org.springframework.data.mongodb.core.BulkOperations.BulkMode;

22 import org.springframework.lang.Nullable;

23 import org.springframework.util.Assert;

123 /*

124 * (non-Javadoc)

125 * @see org.springframework.data.mongodb.core.ExecutableInsertOperation.InsertWithBulkMode#withBulkMode(org.springframework.data.mongodb.core.BulkMode)

126 */

127 @Override

ChangeStreamEvent.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 219 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.time.Instant;

22 import org.bson.BsonValue;

23 import org.bson.Document;

24 import org.springframework.data.mongodb.core.convert.MongoConverter;

25 import org.springframework.data.mongodb.core.messaging.Message;

28 import org.springframework.util.ObjectUtils;

29

30 import com.mongodb.client.model.changestream.ChangeStreamDocument;

31 import com.mongodb.client.model.changestream.OperationType;

32

33 /**

34 * {@link Message} implementation specific to MongoDB <a href="https://docs.mongodb.com/manual/changeStreams/">Change

35 * Streams</a>.

36 *

CompositeByteBuf.java (https://github.com/foursquare/mongo-java-driver.git) Java · 343 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import org.bson.ByteBuf;

AbstractMongoDBExternalResourceAnalyzer.java (https://github.com/spring-projects/spring-insight-plugins.git) Java · 71 lines

15 */

16

17 package com.springsource.insight.plugin.mongodb;

18

19 import java.util.ArrayList;

37 public abstract class AbstractMongoDBExternalResourceAnalyzer extends AbstractExternalResourceAnalyzer {

38 public static final String MONGODB_VENDOR = "MongoDB";

39

40 protected AbstractMongoDBExternalResourceAnalyzer(OperationType type) {

60 dbName,

61 ExternalResourceType.DOCSTORE.name(),

62 MONGODB_VENDOR,

63 host,

64 port,

CompoundSearchOperatorBase.java (https://github.com/jyemin/mongo-java-driver.git) Java · 71 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.client.model.search;

17

18 import com.mongodb.annotations.Beta;

19 import com.mongodb.annotations.Evolving;

20

21 /**

ChartController.java (https://github.com/markfisher/springone-wgrus.git) Java · 90 lines

6

7 import org.springframework.beans.factory.annotation.Autowired;

8 import org.springframework.data.mongodb.core.MongoTemplate;

9 import org.springframework.stereotype.Controller;

10 import org.springframework.web.bind.annotation.RequestMapping;

GeometryCollectionCodec.java (https://github.com/foursquare/mongo-java-driver.git) Java · 79 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

13 */

14

15 package com.mongodb.client.model.geojson.codecs;

16

17 import com.mongodb.client.model.geojson.Geometry;

18 import com.mongodb.client.model.geojson.GeometryCollection;

19 import org.bson.BsonReader;

20 import org.bson.BsonWriter;

24 import org.bson.codecs.configuration.CodecRegistry;

25

26 import static com.mongodb.assertions.Assertions.notNull;

27 import static com.mongodb.client.model.geojson.codecs.GeometryCodecHelper.encodeCoordinateReferenceSystem;

JsonPoweredTestHelper.java (https://github.com/foursquare/mongo-java-driver.git) Java · 80 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

Binary.java (https://github.com/foursquare/mongo-java-driver.git) Java · 117 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

BsonTimestamp.java (https://github.com/foursquare/mongo-java-driver.git) Java · 116 lines

1 /*

2 * Copyright (c) 2008-2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

SingleConnectionBinding.java (git://github.com/mongodb/mongo-java-driver.git) Java · 153 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.binding;

18

19 import com.mongodb.ReadPreference;

20 import com.mongodb.connection.Cluster;

21 import com.mongodb.connection.Connection;

22 import com.mongodb.connection.Server;

23 import com.mongodb.connection.ServerDescription;

ContainerMatrixTestsDiscoverySelectorResolver.java (https://github.com/Graylog2/graylog2-server.git) Java · 47 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.junit.jupiter.engine.discovery;

QueryValidationServiceImpl.java (https://github.com/Graylog2/graylog2-server.git) Java · 70 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog.plugins.views.search.validation;

FileDAOImpl.java (https://gitlab.com/AimeTPGM/OfficerBossProject) Java · 133 lines

11 import org.springframework.data.mongodb.core.query.Criteria;

12 import org.springframework.data.mongodb.core.query.Query;

13

14 import com.mongodb.BasicDBObject;

15 import com.mongodb.DB;

16 import com.mongodb.DBCursor;

17 import com.mongodb.DBObject;

18 import com.mongodb.gridfs.GridFS;

19 import com.mongodb.gridfs.GridFSDBFile;

22 import main.model.MyFile;

23 import main.model.MyFileWithoutIS;

24 import mongodb.main.MongoDBMain;

25

26 public class FileDAOImpl implements FileDAO{

DocumentOperators.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 222 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.aggregation;

17

18 import java.util.Collections;

ElasticsearchConfiguration.java (https://github.com/Graylog2/graylog2-server.git) Java · 194 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog2.configuration;

Keywords.java (https://gitlab.com/QawsQAER/riskadvisor) Java · 134 lines

1 package edu.cmu.sv.webcrawler.models;

2

3 import com.mongodb.*;

4 import edu.cmu.sv.webcrawler.util.MongoHelper;

5

MongoCommandException.java (https://github.com/jyemin/mongo-java-driver.git) Java · 127 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.BsonArray;

30

31 /**

32 * An exception indicating that a command sent to a MongoDB server returned a failure.

33 *

34 * @since 2.13

68 * @return the error code name, which may be the empty string

69 * @since 3.8

70 * @mongodb.server.release 3.4

71 */

72 public String getErrorCodeName() {

DefaultEntryParser.java (https://github.com/lightningdb/chililog-server.git) Java · 106 lines

28 import org.chililog.server.data.RepositoryEntryBO.Severity;

29

30 import com.mongodb.DBObject;

31

32 /**

75 * @param message

76 * The text for this entry to parse

77 * @return <code>RepositoryEntryBO</code> ready for saving to mongoDB. If the entry cannot be parsed, then null is

78 * returned

79 */

InsertOptions.java (https://github.com/jyemin/mongo-java-driver.git) Java · 121 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.lang.Nullable;

20

21 /**

22 * Options related to insertion of documents into MongoDB. The setter methods return {@code this} so that a chaining style can be used.

23 *

24 * @since 2.13

25 * @mongodb.driver.manual tutorial/insert-documents/ Insert Tutorial

26 */

27 public final class InsertOptions {

TestActivity.java (https://github.com/zhijun/fusion.git) Java · 118 lines

24 import com.google.code.morphia.Datastore;

25 import com.google.code.morphia.Morphia;

26 import com.mongodb.DB;

27 import com.mongodb.Mongo;

CursorIterator.java (https://github.com/javastory/jmongo.git) Java · 218 lines

1 /**

2 * JMongo is a mongodb driver writtern in java.

3 * Copyright (C) 2010 Xiaohu Huang

4 *

MongoDbAcceptableUsagePolicyRepositoryTests.java (https://github.com/frett/cas.git) Java · 43 lines

1 package org.apereo.cas.aup;

2

3 import org.apereo.cas.category.MongoDbCategory;

4 import org.apereo.cas.config.CasAcceptableUsagePolicyMongoDbConfiguration;

14

15 /**

16 * This is {@link MongoDbAcceptableUsagePolicyRepositoryTests}.

17 *

18 * @author Misagh Moayyed

19 * @since 5.3.0

20 */

21 @Category(MongoDbCategory.class)

22 @Import(CasAcceptableUsagePolicyMongoDbConfiguration.class)

35 )

36 @Getter

37 public class MongoDbAcceptableUsagePolicyRepositoryTests extends BaseAcceptableUsagePolicyRepositoryTests {

38

39 @Autowired

TaskFactoryUnitTests.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 81 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.messaging;

17

18 import static org.assertj.core.api.Assertions.*;

26 import org.mockito.junit.jupiter.MockitoExtension;

27

28 import org.springframework.data.mongodb.core.MongoTemplate;

29 import org.springframework.data.mongodb.core.convert.MongoConverter;

30 import org.springframework.data.mongodb.core.messaging.ChangeStreamRequest.ChangeStreamRequestOptions;

31 import org.springframework.data.mongodb.core.messaging.SubscriptionRequest.RequestOptions;

RegexFlags.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 116 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.util;

17

18 import java.util.regex.Pattern;

21

22 /**

23 * Utility to translate {@link Pattern#flags() regex flags} to MongoDB regex options and vice versa.

24 *

25 * @author Mark Paluch

47

48 /**

49 * Lookup the MongoDB specific options from given {@link Pattern#flags() flags}.

50 *

51 * @param flags the Regex flags to look up.

ReplicaSets.java (https://github.com/debezium/debezium.git) Java · 231 lines

4 * Licensed under the Apache Software License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0

5 */

6 package io.debezium.connector.mongodb;

7

8 import java.util.ArrayList;

ReactiveMongoDbMessageSourceSpec.java (https://github.com/artembilan/spring-integration.git) Java · 46 lines

15 */

16

17 package org.springframework.integration.mongodb.dsl;

18

19 import org.springframework.data.mongodb.ReactiveMongoDatabaseFactory;

20 import org.springframework.data.mongodb.core.ReactiveMongoOperations;

21 import org.springframework.expression.Expression;

22 import org.springframework.integration.mongodb.inbound.ReactiveMongoDbMessageSource;

23

24 /**

25 * A {@link AbstractMongoDbMessageSourceSpec} implementation for a {@link ReactiveMongoDbMessageSource}.

26 *

27 * @author Artem Bilan

31 public class ReactiveMongoDbMessageSourceSpec

32 extends AbstractMongoDbMessageSourceSpec<ReactiveMongoDbMessageSourceSpec, ReactiveMongoDbMessageSource> {

33

34 protected ReactiveMongoDbMessageSourceSpec(ReactiveMongoDatabaseFactory reactiveMongoDatabaseFactory,

MongoInputFormat.java (https://github.com/muddydixon/mongo-hadoop.git) Java · 72 lines

16 */

17

18 package com.mongodb.hadoop.mapred;

19

20 import java.util.*;

21

22 import com.mongodb.hadoop.input.*;

23 import com.mongodb.hadoop.mapred.input.MongoInputSplit;

24 import com.mongodb.hadoop.mapred.input.MongoRecordReader;

25 import com.mongodb.hadoop.util.*;

34 import org.bson.*;

35

36 import com.mongodb.hadoop.MongoConfig;

37 import com.mongodb.hadoop.mapred.input.*;

SimpleCategoryCriteriaGenerator.java (https://github.com/rackerlabs/atom-hopper.git) Java · 88 lines

1 package org.atomhopper.mongodb.query;

2

3 import java.util.LinkedList;

4 import java.util.List;

5 import org.springframework.data.mongodb.core.query.Criteria;

6 import org.springframework.data.mongodb.core.query.Query;

LazyDBList.java (https://github.com/jyemin/mongo-java-driver.git) Java · 59 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.LazyBSONCallback;

SameObjectProvider.java (https://github.com/jyemin/mongo-java-driver.git) Java · 59 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal.inject;

17

18 import com.mongodb.annotations.ThreadSafe;

19 import com.mongodb.lang.Nullable;

20

21 import java.util.Optional;

22 import java.util.concurrent.atomic.AtomicReference;

23

24 import static com.mongodb.assertions.Assertions.assertNotNull;

25 import static com.mongodb.assertions.Assertions.assertTrue;

VisibleForTesting.java (https://github.com/jyemin/mongo-java-driver.git) Java · 47 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal;

17

18 import java.lang.annotation.Documented;

RenameCollectionOptions.java (https://github.com/jyemin/mongo-java-driver.git) Java · 54 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.model;

18

19 /**

20 * The options to apply when renaming a collection.

21 *

22 * @mongodb.driver.manual reference/command/renameCollection renameCollection

23 * @since 3.0

24 */

UnifiedTestValidator.java (https://github.com/jyemin/mongo-java-driver.git) Java · 46 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.unified;

18

19 import com.mongodb.lang.Nullable;

DatabaseTestCase.java (https://github.com/foursquare/mongo-java-driver.git) Java · 54 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.junit.After;

20 import org.junit.Before;

21

22 import static com.mongodb.Fixture.getDefaultDatabaseName;

23 import static com.mongodb.Fixture.getMongoClient;

LazyDBList.java (https://github.com/foursquare/mongo-java-driver.git) Java · 59 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.LazyBSONCallback;

UuidCodecProvider.java (https://github.com/foursquare/mongo-java-driver.git) Java · 55 lines

1 /*

2 * Copyright 2014-2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

EnableReactiveMongoRepositories.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 143 lines

15 */

16

17 package org.springframework.data.mongodb.repository.config;

18

19 import java.lang.annotation.Documented;

27 import org.springframework.context.annotation.ComponentScan.Filter;

28 import org.springframework.context.annotation.Import;

29 import org.springframework.data.mongodb.core.MongoTemplate;

30 import org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean;

31 import org.springframework.data.mongodb.repository.support.ReactiveMongoRepositoryFactoryBean;

32 import org.springframework.data.repository.config.DefaultRepositoryBaseClass;

33 import org.springframework.data.repository.query.QueryLookupStrategy;

35

36 /**

37 * Annotation to activate reactive MongoDB repositories. If no base package is configured through either

38 * {@link #value()}, {@link #basePackages()} or {@link #basePackageClasses()} it will trigger scanning of the package of

39 * annotated class.

AggregateExplainOperation.java (https://github.com/mebigfatguy/mongo-java-driver.git) Java · 206 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.operation;

18

19 import com.mongodb.MongoNamespace;

20 import com.mongodb.async.SingleResultCallback;

21 import com.mongodb.binding.AsyncReadBinding;

22 import com.mongodb.binding.ReadBinding;

23 import com.mongodb.client.model.Collation;

ReflectionDBObject.java (https://github.com/fes/mongo-java-driver.git) Java · 249 lines

17 */

18

19 package com.mongodb;

20

21 import java.util.*;

22 import java.lang.reflect.*;

23

24 import com.mongodb.util.*;

25

26 public abstract class ReflectionDBObject implements DBObject {

HomeController.java (https://github.com/opal29/cloudfoundry-samples.git) Java · 125 lines

1 package org.cloudfoundry.services;

2

3 import static org.springframework.data.mongodb.core.query.Criteria.where;

4

5 import java.io.IOException;

16 import org.springframework.beans.factory.annotation.Qualifier;

17 import org.springframework.dao.DataAccessException;

18 import org.springframework.data.mongodb.MongoDbFactory;

19 import org.springframework.data.mongodb.core.CollectionCallback;

35

36 @Autowired(required = false)

37 MongoDbFactory mongoDbFactory;

38

39 @Autowired(required = false)

49 if (mongoDbFactory != null) {

50 services.add("MongoDB: " + mongoDbFactory.getDb().getMongo().getAddress());

51 }

52 Random generator = new Random();

ClientType.java (https://github.com/kkmishra/Kundera.git) Java · 57 lines

26 public enum ClientType

27 {

28 HBASE, PELOPS, MONGODB, THRIFT;

29 static Map<String, ClientType> coll = new HashMap<String, ClientType>();

30

37 coll.put(PELOPS.name(), PELOPS);

38 coll.put(THRIFT.name(), THRIFT);

39 coll.put(MONGODB.name(), MONGODB);

40 }

41

ReferenceMapUtilsTest.java (https://github.com/Graylog2/graylog2-server.git) Java · 163 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog2.contentpacks.model.entities.references;

FindOneAndDeleteOptions.java (https://github.com/jyemin/mongo-java-driver.git) Java · 270 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.model;

18

19 import com.mongodb.lang.Nullable;

24 import java.util.concurrent.TimeUnit;

25

26 import static com.mongodb.assertions.Assertions.notNull;

27 import static java.util.concurrent.TimeUnit.MILLISECONDS;

28

31 *

32 * @since 3.0

33 * @mongodb.driver.manual reference/command/findAndModify/

34 */

35 public class FindOneAndDeleteOptions {

ClientSessionOptions.java (https://github.com/jyemin/mongo-java-driver.git) Java · 222 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.annotations.Immutable;

20 import com.mongodb.annotations.NotThreadSafe;

21 import com.mongodb.lang.Nullable;

22 import com.mongodb.session.ClientSession;

23

24 import java.util.Objects;

Accumulators.java (https://github.com/foursquare/mongo-java-driver.git) Java · 183 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

13 */

14

15 package com.mongodb.client.model;

16

17 /**

18 * Builders for accumulators used in the group pipeline stage of an aggregation pipeline.

19 *

20 * @mongodb.driver.manual core/aggregation-pipeline/ Aggregation pipeline

21 * @mongodb.driver.manual operator/aggregation/group/#accumulator-operator Accumulators

22 * @mongodb.driver.manual meta/aggregation-quick-reference/#aggregation-expressions Expressions

23 * @mongodb.server.release 2.2

CAPI.java (https://github.com/paralect/mongo.git) Java · 168 lines

1

2 /**

3 * Copyright (C) 2018-present MongoDB, Inc.

4 *

5 * This program is free software: you can redistribute it and/or modify

6 * it under the terms of the Server Side Public License, version 1,

7 * as published by MongoDB, Inc.

8 *

9 * This program is distributed in the hope that it will be useful,

14 * You should have received a copy of the Server Side Public License

15 * along with this program. If not, see

16 * <http://www.mongodb.com/licensing/server-side-public-license>.

17 *

18 * As a special exception, the copyright holders give permission to link the

Compressor.java (https://github.com/jyemin/mongo-java-driver.git) Java · 134 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.connection;

18

19 import com.mongodb.MongoInternalException;

DensifyOptionsTest.java (https://github.com/jyemin/mongo-java-driver.git) Java · 106 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.client.model.densify;

17

18 import org.bson.BsonArray;

MongoNamespace.java (https://github.com/foursquare/mongo-java-driver.git) Java · 154 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.annotations.Immutable;

20

21 import static com.mongodb.assertions.Assertions.isTrueArgument;

22 import static com.mongodb.assertions.Assertions.notNull;

23

24 /**

25 * A MongoDB namespace, which includes a database name and collection name.

26 *

27 * @since 3.0

CookieFactory.java (https://github.com/Graylog2/graylog2-server.git) Java · 109 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog2.rest.resources.system;

DBConnection.java (https://gitlab.com/gshipley/kohls-demo) Java · 91 lines

28 @PostConstruct

29 public void afterCreate() {

30 String mongoHost = (System.getenv("MONGODB_SERVICE_HOST") == null) ? "127.0.0.1" : System.getenv("MONGODB_SERVICE_HOST");

31 String mongoPort = (System.getenv("MONGODB_SERVICE_PORT") == null) ? "27017" : System.getenv("MONGODB_SERVICE_PORT");

32 String mongoUser = (System.getenv("MONGODB_USER")== null) ? "mongodb" : System.getenv("MONGODB_USER");

33 String mongoPassword = (System.getenv("MONGODB_PASSWORD") == null) ? "mongodb" : System.getenv("MONGODB_PASSWORD");

34 String mongoDBName = (System.getenv("MONGODB_DATABASE") == null) ? "mongodb" : System.getenv("MONGODB_DATABASE");

35 // Check if we are using a mongoDB template or mongodb RHEL 7 image

46 MongoCredential credential = MongoCredential.createCredential(mongoUser, mongoDBName, mongoPassword.toCharArray());

47 MongoClient mongoClient = new MongoClient(new ServerAddress(mongoHost, Integer.parseInt(mongoPort)), Arrays.asList(credential));

48 mongoDB = mongoClient.getDatabase(mongoDBName);

49 } catch (Exception e) {

50 e.printStackTrace();

MongoInputSplit.java (https://github.com/muddydixon/mongo-hadoop.git) Java · 129 lines

16 */

17

18 package com.mongodb.hadoop.mapred.input;

19

20 import com.mongodb.*;

21 import com.mongodb.hadoop.util.*;

22 import com.mongodb.util.*;

43 }

44

45 public MongoInputSplit( com.mongodb.hadoop.input.MongoInputSplit split ){

46 this(split.getMongoURI(), split.getQuerySpec(), split.getFieldSpec(), split.getSortSpec(), split.getLimit(),

47 split.getSkip());

QuickTour.java (https://github.com/dunwu/spring-tutorial.git) Java · 175 lines

1 package io.github.dunwu.springboot.data.db.mongo;

2

3 import com.mongodb.Block;

4 import com.mongodb.MongoClient;

5 import com.mongodb.MongoClientURI;

6 import com.mongodb.client.MongoCollection;

7 import com.mongodb.client.MongoCursor;

8 import com.mongodb.client.MongoDatabase;

9 import com.mongodb.client.model.*;

10 import com.mongodb.client.result.DeleteResult;

11 import com.mongodb.client.result.UpdateResult;

12 import org.bson.Document;

13

TestInternalConnection.java (https://github.com/foursquare/mongo-java-driver.git) Java · 189 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.MongoException;

20 import com.mongodb.async.SingleResultCallback;

21 import org.bson.ByteBuf;

22 import org.bson.ByteBufNIO;

FindOneAndUpdateOptions.java (https://github.com/foursquare/mongo-java-driver.git) Java · 198 lines

1 /*

2 * Copyright (c) 2008-2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.model;

18

19 import org.bson.conversions.Bson;

21 import java.util.concurrent.TimeUnit;

22

23 import static com.mongodb.assertions.Assertions.notNull;

24 import static java.util.concurrent.TimeUnit.MILLISECONDS;

25

28 *

29 * @since 3.0

30 * @mongodb.driver.manual reference/command/findAndModify/

31 */

32 public class FindOneAndUpdateOptions {

ReplSetTest.java (https://github.com/greenlaw110/mongo-java-driver.git) Java · 100 lines

17 */

18

19 package com.mongodb;

20

21 import java.util.*;

CreateDBInstanceRequest.java (https://github.com/TencentCloud/tencentcloud-sdk-java.git) Java · 344 lines

14 * limitations under the License.

15 */

16 package com.tencentcloudapi.mongodb.v20180408.models;

17

18 import com.tencentcloudapi.common.AbstractModel;

CommandReadOperation.java (https://github.com/jyemin/mongo-java-driver.git) Java · 75 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.operation;

18

19 import com.mongodb.internal.async.SingleResultCallback;

20 import com.mongodb.connection.ConnectionDescription;

21 import com.mongodb.connection.ServerDescription;

22 import com.mongodb.internal.binding.AsyncReadBinding;

23 import com.mongodb.internal.binding.ReadBinding;

Stream.java (https://github.com/foursquare/mongo-java-driver.git) Java · 99 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.ServerAddress;

SamlIdPMongoDbIdPMetadataConfiguration.java (https://github.com/frett/cas.git) Java · 104 lines

55

56 if (crypto.isEnabled()) {

57 return new MongoDbSamlIdPMetadataCipherExecutor(

58 crypto.getEncryption().getKey(),

59 crypto.getSigning().getKey(),

60 crypto.getAlg());

61 }

62 LOGGER.info("MongoDb SAML IdP metadata encryption/signing is turned off and "

63 + "MAY NOT be safe in a production environment. "

64 + "Consider using other choices to handle encryption, signing and verification of "

98 public SamlIdPMetadataLocator samlIdPMetadataLocator() {

99 val idp = casProperties.getAuthn().getSamlIdp();

100 return new MongoDbSamlIdPMetadataLocator(mongoDbSamlIdPMetadataTemplate(),

101 idp.getMetadata().getMongo().getIdpMetadataCollection(),

102 mongoDbSamlIdPMetadataCipherExecutor());

MongodbSinkConnector.java (https://github.com/DataReply/kafka-connect-mongodb.git) Java · 143 lines

1 package org.apache.kafka.connect.mongodb;

2

3 import org.apache.kafka.common.config.ConfigDef;

13

14 import java.util.*;

15 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.HOST;

16 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.PORT;

17 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.BULK_SIZE;

18 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.TOPICS;

19 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.URI;

20 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.DATABASE;

21 import static org.apache.kafka.connect.mongodb.MongodbSinkConfig.COLLECTIONS;

22

23 /**

24 * MongodbSinkConnector implement the Connector interface to send Kafka

25 * data to Mongodb

JJTMQLState.java (git://github.com/geir/mongo-java-driver.git) Java · 140 lines

17 * under the License.

18 */

19 package org.mongodb.mql;

20

21 public class JJTMQLState {

GridFsConverterLoader.java (https://github.com/gnodet/camel.git) Java · 38 lines

1 /* Generated by camel build tools - do NOT edit this file! */

2 package org.apache.camel.component.mongodb.gridfs;

3

4 import org.apache.camel.Exchange;

26

27 private void registerConverters(TypeConverterRegistry registry) {

28 addTypeConverter(registry, com.mongodb.ReadPreference.class, java.lang.String.class, false,

29 (type, exchange, value) -> org.apache.camel.component.mongodb.gridfs.GridFsConverter.toReadPreference((java.lang.String) value, exchange));

30 addTypeConverter(registry, com.mongodb.WriteConcern.class, java.lang.String.class, false,

31 (type, exchange, value) -> org.apache.camel.component.mongodb.gridfs.GridFsConverter.toWriteConcern((java.lang.String) value, exchange));

BasicDBObjectTest.java (https://github.com/d5nguyenvan/mongo-java-driver.git) Java · 205 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.util.JSON;

29 import java.util.TreeMap;

30

31 import static com.mongodb.MongoClient.getDefaultCodecRegistry;

32 import static java.util.Arrays.asList;

33 import static org.hamcrest.CoreMatchers.not;

JavaSimpleExample.java (https://github.com/mongolab/mongodb-driver-examples.git) Java · 112 lines

6 * Documentation: http://api.mongodb.org/java/

7 * A Java class connecting to a MongoDB database given a MongoDB Connection URI.

8 */

9 import java.net.UnknownHostException;

10

11 import com.mongodb.MongoClient;

12 import com.mongodb.MongoClientURI;

13 import com.mongodb.ServerAddress;

14

15 import com.mongodb.client.MongoDatabase;

16 import com.mongodb.client.MongoCollection;

17

18 import org.bson.Document;

ReactiveMongoDatabaseImpl.java (https://github.com/quarkusio/quarkus.git) Java · 341 lines

1 package io.quarkus.mongodb.impl;

2

3 import java.util.List;

6 import org.bson.conversions.Bson;

7

8 import com.mongodb.ReadPreference;

9 import com.mongodb.client.model.CreateCollectionOptions;

10 import com.mongodb.client.model.CreateViewOptions;

11 import com.mongodb.client.model.changestream.ChangeStreamDocument;

12 import com.mongodb.reactivestreams.client.AggregatePublisher;

13 import com.mongodb.reactivestreams.client.ClientSession;

14 import com.mongodb.reactivestreams.client.ListCollectionsPublisher;

15 import com.mongodb.reactivestreams.client.MongoDatabase;

ExposedFieldsUnitTests.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 56 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.aggregation;

17

18 import static org.assertj.core.api.Assertions.*;

20 import org.junit.jupiter.api.Test;

21

22 import org.springframework.data.mongodb.core.aggregation.ExposedFields.ExposedField;

23

24 /**

GeoJsonLineString.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 57 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.geo;

17

18 import java.util.List;

LimitOperation.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 55 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.aggregation;

17

18 import org.bson.Document;

29 * @author Christoph Strobl

30 * @since 1.3

31 * @see <a href="https://docs.mongodb.org/manual/reference/aggregation/limit/">MongoDB Aggregation Framework: $limit</a>

32 */

33 public class LimitOperation implements AggregationOperation {

ServiceDao.java (https://gitlab.com/BGCX261/zonales-svn-to-git.git) Java · 157 lines

6 package org.zonales.crawlConfig.daos;

7

8 import com.mongodb.BasicDBObject;

9 import com.mongodb.DBCollection;

10 import com.mongodb.DBCursor;

11 import com.mongodb.DBObject;

12 import com.mongodb.MongoException;

13 import java.util.ArrayList;

14 import java.util.StringTokenizer;

MongoNonDocumentResourceStorage.java (git://github.com/lucmoreau/ProvToolbox.git) Java · 114 lines

1 package org.openprovenance.prov.storage.mongodb;

2

3 import com.fasterxml.jackson.databind.ObjectMapper;

4 import com.mongodb.*;

5 import org.apache.commons.io.IOUtils;

6 import org.apache.log4j.Logger;

10 import java.io.*;

11 /* Documentation

12 https://howtodoinjava.com/mongodb/java-mongodb-getsave-image-using-gridfs-apis/

13 */

14

SpringCloudConfigurationProperties.java (https://github.com/Jasig/cas.git) Java · 186 lines

41 * MongoDb config settings.

42 */

43 private MongoDb mongo = new MongoDb();

44

45 /**

68 @Setter

69 @Accessors(chain = true)

70 public static class MongoDb implements Serializable {

71 private static final long serialVersionUID = -6509143371334754469L;

72

73 /**

74 * Mongodb URI.

75 */

76 @RequiredProperty

DatasourceQueryServiceImpl.java (https://github.com/WeiYe-Jing/datax-web.git) Java · 115 lines

34 //获取数据源对象

35 JobDatasource datasource = jobDatasourceService.getById(id);

36 return new MongoDBQueryTool(datasource).getDBNames();

37 }

38

48 if (JdbcConstants.HBASE.equals(datasource.getDatasource())) {

49 return new HBaseQueryTool(datasource).getTableNames();

50 } else if (JdbcConstants.MONGODB.equals(datasource.getDatasource())) {

51 return new MongoDBQueryTool(datasource).getCollectionNames(datasource.getDatabaseName());

80 return Lists.newArrayList();

81 }

82 return new MongoDBQueryTool(datasource).getCollectionNames(dbName);

83 }

84

94 if (JdbcConstants.HBASE.equals(datasource.getDatasource())) {

95 return new HBaseQueryTool(datasource).getColumns(tableName);

96 } else if (JdbcConstants.MONGODB.equals(datasource.getDatasource())) {

97 return new MongoDBQueryTool(datasource).getColumns(tableName);

MongoRepository.java (https://github.com/microapp-store/flash-waimai.git) Java · 273 lines

3 import cn.enilu.flash.bean.entity.front.BaseMongoEntity;

4 import cn.enilu.flash.utils.factory.Page;

5 import com.mongodb.client.result.UpdateResult;

6 import org.springframework.beans.factory.annotation.Autowired;

7 import org.springframework.data.domain.PageRequest;

12 import org.springframework.data.geo.Metrics;

13 import org.springframework.data.geo.Point;

14 import org.springframework.data.mongodb.core.MongoTemplate;

15 import org.springframework.data.mongodb.core.query.Criteria;

16 import org.springframework.data.mongodb.core.query.NearQuery;

17 import org.springframework.data.mongodb.core.query.Query;

18 import org.springframework.data.mongodb.core.query.Update;

19 import org.springframework.stereotype.Repository;

20

MongoCandidateSupplier.java (https://github.com/dstl/baleen.git) Java · 128 lines

2 package uk.gov.dstl.baleen.entity.linking.supplier.mongo;

3

4 import static com.mongodb.client.model.Filters.or;

5 import static com.mongodb.client.model.Filters.regex;

18 import org.bson.conversions.Bson;

19

20 import com.mongodb.client.FindIterable;

21 import com.mongodb.client.MongoCollection;

22 import com.mongodb.client.MongoDatabase;

23

24 import uk.gov.dstl.baleen.entity.linking.Candidate;

ServiceRepositoryImpl.java (https://github.com/microcks/microcks.git) Java · 110 lines

24 import org.slf4j.LoggerFactory;

25 import org.springframework.beans.factory.annotation.Autowired;

26 import org.springframework.data.mongodb.core.MongoTemplate;

27 import org.springframework.data.mongodb.core.aggregation.Aggregation;

28 import org.springframework.data.mongodb.core.aggregation.AggregationResults;

29 import org.springframework.data.mongodb.core.aggregation.ObjectOperators;

30 import org.springframework.data.mongodb.core.query.Criteria;

31 import org.springframework.data.mongodb.core.query.Query;

36

37 import static org.springframework.data.domain.Sort.Direction.DESC;

38 import static org.springframework.data.mongodb.core.aggregation.Aggregation.*;

39 /**

40 * Implementation for CustomServiceRepository.

AttachmentKeys.java (https://github.com/jyemin/mongo-java-driver.git) Java · 106 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal.operation.retry;

17

18 import com.mongodb.annotations.Immutable;

19 import com.mongodb.bulk.BulkWriteResult;

20 import com.mongodb.internal.async.function.LoopState.AttachmentKey;

21 import com.mongodb.internal.operation.MixedBulkWriteOperation.BulkWriteTracker;

22 import org.bson.BsonDocument;

23

PlainAuthenticatorUnitTest.java (https://github.com/jyemin/mongo-java-driver.git) Java · 93 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.connection;

18

19 import com.mongodb.MongoCredential;

20 import com.mongodb.ServerAddress;

21 import com.mongodb.async.FutureResultCallback;

22 import com.mongodb.connection.ClusterConnectionMode;

23 import com.mongodb.connection.ClusterId;

ClientAcceptanceTest.java (https://github.com/foursquare/mongo-java-driver.git) Java · 106 lines

1 /*

2 * Copyright (c) 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.acceptancetest.core;

18

19 import com.mongodb.client.DatabaseTestCase;

20 import com.mongodb.client.MongoDatabase;

21 import org.bson.Document;

22 import org.hamcrest.BaseMatcher;

CreateIndexCommitQuorum.java (https://github.com/jyemin/mongo-java-driver.git) Java · 163 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.BsonInt32;

21 import org.bson.BsonValue;

22

23 import static com.mongodb.assertions.Assertions.notNull;

24

25 /**

27 * complete the index builds successfully before the primary marks the indexes as ready.

28 *

29 * @mongodb.driver.manual reference/command/createIndexes/ Create indexes

30 * @mongodb.server.release 4.4

MongoInputFormat.java (https://github.com/thainb/mongo-hadoop.git) Java · 77 lines

16 */

17

18 package com.mongodb.hadoop.mapred;

19

20 import java.util.*;

26 import org.bson.*;

27

28 import com.mongodb.hadoop.MongoConfig;

29 import com.mongodb.hadoop.mapred.input.*;

30 import com.mongodb.hadoop.io.*;

31

32 @SuppressWarnings("deprecation")

ListCollectionsIterableImpl.java (https://github.com/foursquare/mongo-java-driver.git) Java · 126 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.async.client;

18

19 import com.mongodb.Block;

20 import com.mongodb.Function;

21 import com.mongodb.ReadPreference;

22 import com.mongodb.async.AsyncBatchCursor;

23 import com.mongodb.async.SingleResultCallback;

CredentialsDtoTest.java (https://github.com/eclipse/hono.git) Java · 117 lines

13

14

15 package org.eclipse.hono.deviceregistry.mongodb.model;

16

17 import static org.assertj.core.api.Assertions.assertThat;

TxnClientSessionFactory.java (https://github.com/SoftInstigate/restheart.git) Java · 191 lines

1 /*-

2 * ========================LICENSE_START=================================

3 * restheart-mongodb

4 * %%

5 * Copyright (C) 2014 - 2020 SoftInstigate

19 * =========================LICENSE_END==================================

20 */

21 package org.restheart.mongodb.db.sessions;

22

23 import com.mongodb.ClientSessionOptions;

24 import com.mongodb.ReadConcern;

25 import com.mongodb.ReadPreference;

26 import com.mongodb.TransactionOptions;

27 import com.mongodb.WriteConcern;

CreateCosmosDBWithKindMongoDB.java (git://github.com/WindowsAzure/azure-sdk-for-java.git) Java · 122 lines

20 /**

21 * Azure CosmosDB sample for high availability.

22 * - Create a CosmosDB configured with MongoDB kind.

23 * - Get the mongodb connection string

24 * - Delete the CosmosDB.

25 */

26 public final class CreateCosmosDBWithKindMongoDB {

27 static final String DATABASE_ID = "TestDB";

28 static final String COLLECTION_ID = "TestCollection";

54 Utils.print(cosmosDBAccount);

55

56 System.out.println("Get the MongoDB connection string");

57 DatabaseAccountListConnectionStringsResult databaseAccountListConnectionStringsResult = cosmosDBAccount.listConnectionStrings();

58 System.out.println("MongoDB connection string: "

118 }

119

120 private CreateCosmosDBWithKindMongoDB() {

121 }

122 }

MongoDbThrottledSubmissionHandlerInterceptorAdapter.java (https://github.com/frett/cas.git) Java · 72 lines

9 import org.apereo.inspektr.common.web.ClientInfoHolder;

10 import org.springframework.data.domain.Sort;

11 import org.springframework.data.mongodb.core.MongoTemplate;

12 import org.springframework.data.mongodb.core.query.Criteria;

13 import org.springframework.data.mongodb.core.query.Query;

14

15 import javax.servlet.http.HttpServletRequest;

23 */

24 @Slf4j

25 public class MongoDbThrottledSubmissionHandlerInterceptorAdapter extends AbstractInspektrAuditHandlerInterceptorAdapter {

26 private final transient MongoTemplate mongoTemplate;

27 private final String collectionName;

28

29 public MongoDbThrottledSubmissionHandlerInterceptorAdapter(final int failureThreshold,

30 final int failureRangeInSeconds,

31 final String usernameParameter,

ExecutableUpdateOperation.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 291 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.util.Optional;

19

20 import org.springframework.data.mongodb.core.aggregation.AggregationUpdate;

21 import org.springframework.data.mongodb.core.query.CriteriaDefinition;

22 import org.springframework.data.mongodb.core.query.Query;

23 import org.springframework.data.mongodb.core.query.Update;

24 import org.springframework.data.mongodb.core.query.UpdateDefinition;

25 import org.springframework.lang.Nullable;

26

TailableCursorRequest.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 269 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.messaging;

17

18 import java.util.Optional;

19

20 import org.bson.Document;

21 import org.springframework.data.mongodb.core.messaging.SubscriptionRequest.RequestOptions;

22 import org.springframework.data.mongodb.core.messaging.TailableCursorRequest.TailableCursorRequestOptions.TailableCursorRequestOptionsBuilder;

23 import org.springframework.data.mongodb.core.query.Query;

24 import org.springframework.lang.Nullable;

25 import org.springframework.util.Assert;

27 /**

28 * {@link SubscriptionRequest} implementation to be used to listen to query results in a

29 * <a href="https://docs.mongodb.com/manual/core/capped-collections/">Capped Collection</a> using a

30 * <a href="https://docs.mongodb.com/manual/core/tailable-cursors/">Tailable Cursor</a>.

QuestionDAOImpl.java (https://bitbucket.org/itbelts/itbelts.git) Java · 106 lines

18

19 /**

20 * MongoDB implementation for the IQuestionDAO. <br>

21 * <br>

22 * <u><i>Version History</i></u>

MongoLoader.java (https://github.com/huangbenhua/MongoQL.git) Java · 151 lines

17 import com.julewan.mongo.Mongoes;

18 import com.julewan.mongo.ql.Statement;

19 import com.mongodb.DB;

20 import com.mongodb.DBCollection;

21 import com.mongodb.Mongo;

22

23 public class MongoLoader {

33 //////////////////

34 private Mongo mongo = null;

35 private Map<String, DB> mongoDBs = Collections.synchronizedMap(new HashMap<String, DB>());

36 private Map<String, Mongoes> mongoesMap = Collections.synchronizedMap(new HashMap<String, Mongoes>());

37 public MongoLoader(Properties props){

56 //防止错误

57 name = name.replace(".", "").replaceAll("\\s", "");

58 DB db = mongoDBs.get(name);

59 if(db == null){

60 db = mongo.getDB(name);

ReplPairTest.java (git://github.com/mongodb/mongo-java-driver.git) Java · 88 lines ✨ Summary

This Java code creates a test for replication pairs in MongoDB by starting multiple threads that continuously query and update a collection on two different servers, simulating a replication pair. The main thread updates the document and prints the result every 500 milliseconds. If an exception occurs, it catches and prints the error message.

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

17 // ReplPairTest.java

18

19 package com.mongodb;

20

21 import java.util.ArrayList;

TestConnection.java (https://github.com/foursquare/mongo-java-driver.git) Java · 262 lines

1 /*

2 * Copyright (c) 2008-2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.MongoNamespace;

20 import com.mongodb.WriteConcern;

21 import com.mongodb.WriteConcernResult;

22 import com.mongodb.async.SingleResultCallback;

23 import com.mongodb.bulk.BulkWriteResult;

FastMapper.java (https://bitbucket.org/yangibaev/g6) Java · 189 lines

12 import java.util.concurrent.ConcurrentHashMap;

13

14 import com.mongodb.BasicDBList;

15 import com.mongodb.BasicDBObject;

16 import net.sf.cglib.reflect.FastClass;

17

18 import com.mongodb.DBObject;

19 import org.bson.types.ObjectId;

20

SimpleMongoRepositoryConfiguration.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 197 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.repository.config;

17

18 import org.springframework.data.mongodb.repository.support.MongoRepositoryFactoryBean;

49

50 /**

51 * Returns the bean name of the {@link org.springframework.data.mongodb.core.core.MongoTemplate} to be referenced.

52 *

53 * @return

137 * (non-Javadoc)

138 *

139 * @see org.springframework.data.mongodb.repository.config.

140 * SimpleMongoRepositoryConfiguration

141 * .MongoRepositoryConfiguration#getMongoTemplateRef()

StoreResource.java (https://gitlab.com/gshipley/kohls-demo) Java · 98 lines

1 package org.openshift.parks.rest;

2

3 import com.mongodb.BasicDBObject;

4 import com.mongodb.client.MongoCollection;

5 import com.mongodb.client.MongoCursor;

6 import org.bson.Document;

7 import org.bson.types.ObjectId;

ReactiveUpdateOperationSupport.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 185 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import reactor.core.publisher.Mono;

19

20 import org.springframework.data.mongodb.core.query.Query;

21 import org.springframework.data.mongodb.core.query.UpdateDefinition;

24 import org.springframework.util.StringUtils;

25

26 import com.mongodb.client.result.UpdateResult;

27

28 /**

58 private final Class<?> domainType;

59 private final Query query;

60 private final org.springframework.data.mongodb.core.query.UpdateDefinition update;

61 @Nullable private final String collection;

62 @Nullable private final FindAndModifyOptions findAndModifyOptions;

CountQuery.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 227 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.util.ArrayList;

MongoDataStoreFactory.java (https://gitlab.com/essere.lab.public/qualitas.class-corpus) Java · 116 lines

1 package org.geotools.data.mongodb;

2

3 import java.awt.RenderingHints;

34 {

35

36 private static final String FACTORY_DESCRIPTION = "MongoDB GeoServer Plugin";

37 private static final String FACTORY_DISPLAY_NAME = "MongoDB";

67 {

68 // basic check to ensure mongo jar available

69 Class.forName( "com.mongodb.BasicDBObject" );

70 result = true;

71 }

72 catch (Throwable t)

73 {

74 log.severe( "Mongo Plugin: The MongoDB JAR file was not found on the class path." );

75 }

76 return result;

MongoConfiguration.java (https://github.com/otto-de/edison-microservice.git) Java · 70 lines

1 package de.otto.edison.mongo.configuration;

2

3 import com.mongodb.*;

4 import com.mongodb.client.MongoClient;

5 import com.mongodb.client.MongoClients;

6 import com.mongodb.client.MongoDatabase;

17 import java.util.List;

18

19 import static com.mongodb.MongoCredential.createCredential;

20 import static org.slf4j.LoggerFactory.getLogger;

21

MongoJobsConfiguration.java (https://github.com/otto-de/edison-microservice.git) Java · 49 lines

1 package de.otto.edison.jobs.configuration;

2

3 import com.mongodb.client.MongoClient;

4 import com.mongodb.client.MongoDatabase;

GongfengStatProjDao.java (https://github.com/Tencent/bk-ci.git) Java · 96 lines

30 import org.apache.commons.collections.CollectionUtils;

31 import org.springframework.beans.factory.annotation.Autowired;

32 import org.springframework.data.mongodb.core.BulkOperations;

33 import org.springframework.data.mongodb.core.MongoTemplate;

34 import org.springframework.data.mongodb.core.query.Criteria;

35 import org.springframework.data.mongodb.core.query.Query;

36 import org.springframework.data.mongodb.core.query.Update;

37 import org.springframework.stereotype.Repository;

38

MongoTemplateUnwrappedTests.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 138 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import static org.assertj.core.api.Assertions.*;

19 import static org.springframework.data.mongodb.core.query.Criteria.*;

20 import static org.springframework.data.mongodb.core.query.Query.*;

28 import org.junit.jupiter.api.Test;

29 import org.junit.jupiter.api.extension.ExtendWith;

30 import org.springframework.data.mongodb.core.mapping.Field;

31 import org.springframework.data.mongodb.core.mapping.Unwrapped;

32 import org.springframework.data.mongodb.core.query.Query;

33 import org.springframework.data.mongodb.test.util.MongoTemplateExtension;

MongoDriverConnectInterceptor3_0.java (https://github.com/naver/pinpoint.git) Java · 155 lines

17 package com.navercorp.pinpoint.plugin.mongo.interceptor;

18

19 import com.mongodb.MongoClientOptions;

20 import com.mongodb.ServerAddress;

21 import com.mongodb.connection.Cluster;

22 import com.mongodb.connection.ClusterDescription;

23 import com.mongodb.connection.ServerDescription;

24 import com.navercorp.pinpoint.bootstrap.context.DatabaseInfo;

25 import com.navercorp.pinpoint.bootstrap.interceptor.AroundInterceptor;

96 private DatabaseInfo createDatabaseInfo(List<String> hostList, String readPreference, String writeConcern) {

97

98 DatabaseInfo databaseInfo = new MongoDatabaseInfo(MongoConstants.MONGODB, MongoConstants.MONGO_EXECUTE_QUERY,

99 null, null, hostList, null, null, readPreference, writeConcern);

100

MongoDataStore.java (https://github.com/saravanak/Dandanakka.git) Java · 259 lines

1 package com.dandanakka.datastore.mongodb;

2

3 import java.io.IOException;

16 import com.dandanakka.datastore.model.PaginatedResult;

17 import com.dandanakka.datastore.model.Query;

18 import com.mongodb.BasicDBObject;

19 import com.mongodb.CommandResult;

20 import com.mongodb.DB;

21 import com.mongodb.DBCursor;

22 import com.mongodb.DBObject;

23 import com.mongodb.Mongo;

24 import com.mongodb.MongoException;

25 import com.mongodb.QueryBuilder;

AggregationOptionsTests.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 85 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.aggregation;

17

18 import static org.assertj.core.api.Assertions.*;

19 import static org.springframework.data.mongodb.core.aggregation.Aggregation.*;

20

21 import org.bson.Document;

CommandMarker.java (https://github.com/jyemin/mongo-java-driver.git) Java · 118 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.reactivestreams.client.internal.crypt;

18

19 import com.mongodb.AutoEncryptionSettings;

20 import com.mongodb.MongoClientException;

21 import com.mongodb.MongoException;

22 import com.mongodb.ReadConcern;

23 import com.mongodb.ReadPreference;

MongoUtilTest.java (https://github.com/geotools/geotools.git) Java · 73 lines

16 * Lesser General Public License for more details.

17 */

18 package org.geotools.data.mongodb;

19

20 import static org.hamcrest.CoreMatchers.equalTo;

24 import static org.junit.Assert.assertTrue;

25

26 import com.mongodb.BasicDBObject;

27 import com.mongodb.DBObject;

ImageCache.java (https://github.com/shangrz/FlipDroid.git) Java · 84 lines

23

24 /**

25 * Implements a cache capable of caching it.tika.mongodb.image files. It exposes helper methods to immediately

26 * access binary it.tika.mongodb.image data as {@link android.graphics.Bitmap} objects.

FindOneAndReplaceOptions.java (https://github.com/jyemin/mongo-java-driver.git) Java · 336 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.model;

18

19 import com.mongodb.lang.Nullable;

24 import java.util.concurrent.TimeUnit;

25

26 import static com.mongodb.assertions.Assertions.notNull;

27 import static java.util.concurrent.TimeUnit.MILLISECONDS;

28

30 * The options to apply to an operation that atomically finds a document and replaces it.

31 *

32 * @mongodb.driver.manual reference/command/findAndModify/

33 * @since 3.0

34 */

ReferenceDataRepository.java (https://github.com/remotesyssupport/vcap-test-assets.git) Java · 150 lines

18 import redis.clients.jedis.Jedis;

19

20 import com.mongodb.BasicDBObject;

21 import com.mongodb.DB;

22 import com.mongodb.DBCollection;

23 import com.mongodb.DBCursor;

24 import com.mongodb.Mongo;

25 import com.mongodb.MongoException;

ServerAddress.java (https://github.com/jyemin/mongo-java-driver.git) Java · 243 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.annotations.Immutable;

20 import com.mongodb.lang.Nullable;

21

22 import java.io.Serializable;

DropUserOperation.java (https://github.com/foursquare/mongo-java-driver.git) Java · 147 lines

1 /*

2 * Copyright (c) 2008-2016 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.operation;

18

19 import com.mongodb.MongoCommandException;

20 import com.mongodb.MongoNamespace;

21 import com.mongodb.WriteConcern;

22 import com.mongodb.WriteConcernResult;

23 import com.mongodb.async.SingleResultCallback;

MongoDbTicketRegistryTicketCatalogConfiguration.java (https://github.com/frett/cas.git) Java · 59 lines

10

11 /**

12 * This is {@link MongoDbTicketRegistryTicketCatalogConfiguration}.

13 *

14 * @author Misagh Moayyed

15 * @since 5.2.0

16 */

17 @Configuration("mongoDbTicketRegistryTicketCatalogConfiguration")

18 @EnableConfigurationProperties(CasConfigurationProperties.class)

19 public class MongoDbTicketRegistryTicketCatalogConfiguration extends CasCoreTicketCatalogConfiguration {

MongodbBinaryStoreTest.java (https://github.com/hchiorean/modeshape.git) Java · 84 lines

32

33 /**

34 * Setup mongodb env and uncomment tests to run.

35 *

36 * @author kulikov

37 * @author Horia Chiorean (hchiorea@redhat.com)

38 */

39 public class MongodbBinaryStoreTest extends AbstractBinaryStoreTest {

40 private static final Logger LOGGER = Logger.getLogger("MongoDBOutput");

43 private static MongodExecutable mongodExecutable;

44

45 private static MongodbBinaryStore binaryStore;

46

47 static {

48 try {

49 LOGGER.addHandler(new FileHandler("target/mongoDB_output.txt", false));

50 LOGGER.setLevel(Level.SEVERE);

51 } catch (IOException e) {

MongoInsertEventListener.java (https://github.com/YunaiV/SpringBoot-Labs.git) Java · 69 lines

1 package cn.iocoder.springboot.lab16.springdatamongodb.mongo;

2

3 import org.springframework.beans.factory.annotation.Autowired;

4 import org.springframework.data.mongodb.core.FindAndModifyOptions;

5 import org.springframework.data.mongodb.core.MongoTemplate;

6 import org.springframework.data.mongodb.core.mapping.event.AbstractMongoEventListener;

7 import org.springframework.data.mongodb.core.mapping.event.BeforeConvertEvent;

8 import org.springframework.data.mongodb.core.query.Criteria;

9 import org.springframework.data.mongodb.core.query.Query;

10 import org.springframework.data.mongodb.core.query.Update;

11 import org.springframework.stereotype.Component;

12

CasAcceptableUsagePolicyMongoDbConfiguration.java (https://github.com/Jasig/cas.git) Java · 74 lines

2

3 import org.apereo.cas.aup.AcceptableUsagePolicyRepository;

4 import org.apereo.cas.aup.MongoDbAcceptableUsagePolicyRepository;

5 import org.apereo.cas.authentication.CasSSLContext;

6 import org.apereo.cas.configuration.CasConfigurationProperties;

7 import org.apereo.cas.configuration.features.CasFeatureModule;

8 import org.apereo.cas.mongo.MongoDbConnectionFactory;

9 import org.apereo.cas.ticket.registry.TicketRegistrySupport;

10 import org.apereo.cas.util.spring.beans.BeanSupplier;

20 import org.springframework.context.annotation.Bean;

21 import org.springframework.context.annotation.ScopedProxyMode;

22 import org.springframework.data.mongodb.core.MongoOperations;

23

24 /**

MongoDbMultifactorAuthenticationTrustStorage.java (https://github.com/Jasig/cas.git) Java · 107 lines

9 import lombok.extern.slf4j.Slf4j;

10 import lombok.val;

11 import org.springframework.data.mongodb.core.MongoOperations;

12 import org.springframework.data.mongodb.core.query.Criteria;

13 import org.springframework.data.mongodb.core.query.Query;

14

15 import java.io.Serializable;

19

20 /**

21 * This is {@link MongoDbMultifactorAuthenticationTrustStorage}.

22 *

23 * @author Misagh Moayyed

25 */

26 @Slf4j

27 public class MongoDbMultifactorAuthenticationTrustStorage extends BaseMultifactorAuthenticationTrustStorage {

28 private final MongoOperations mongoTemplate;

29

CriteriaTests.java (https://gitlab.com/javajamesb08/spring-data-mongodb.git) Java · 167 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.query;

17

18 import static org.hamcrest.CoreMatchers.*;

20

21 import org.junit.Test;

22 import org.springframework.data.mongodb.InvalidMongoDbApiUsageException;

23

24 import com.mongodb.BasicDBObject;

25 import com.mongodb.BasicDBObjectBuilder;

26 import com.mongodb.DBObject;

60 }

61

62 @Test(expected = InvalidMongoDbApiUsageException.class)

63 public void testCriteriaWithMultipleConditionsForSameKey() {

64 Criteria c = new Criteria("name").gte("M").and("name").ne("A");

MongoDbOperationCollectionAspectTest.java (https://github.com/spring-projects/spring-insight-plugins.git) Java · 92 lines

15 */

16

17 package com.springsource.insight.plugin.mongodb;

18

19 import static org.mockito.Mockito.mock;

22 import org.junit.Test;

23

24 import com.mongodb.DB;

25 import com.mongodb.Mongo;

26 import com.mongodb.ServerAddress;

27 import com.springsource.insight.collection.test.OperationCollectionAspectTestSupport;

28 import com.springsource.insight.intercept.operation.Operation;

32 /**

33 */

34 public class MongoDbOperationCollectionAspectTest

35 extends OperationCollectionAspectTestSupport {

36 public MongoDbOperationCollectionAspectTest() {

_PersistentTokenRepository.java (https://gitlab.com/augurpl/gitlab-ci-hipster-image) Java · 109 lines

8 import java.time.LocalDate;

9 import org.springframework.data.jpa.repository.JpaRepository;

10 <% } %><% if (databaseType == 'mongodb') { %>

11 import java.time.LocalDate;

12 import org.springframework.data.mongodb.repository.MongoRepository;

21 <% if (databaseType == 'sql') { %>/**

22 * Spring Data JPA repository for the PersistentToken entity.

23 */<% } %><% if (databaseType == 'mongodb') { %>/**

24 * Spring Data MongoDB repository for the PersistentToken entity.

25 */<% } %><% if (databaseType == 'cassandra') { %>/**

26 * Cassandra repository for the PersistentToken entity.

27 */<% } %><% if (databaseType == 'sql' || databaseType == 'mongodb') { %>

28 public interface PersistentTokenRepository extends <% if (databaseType == 'sql') { %>JpaRepository<% } %><% if (databaseType == 'mongodb') { %>MongoRepository<% } %><PersistentToken, String> {

mongodb-core-document.java (https://github.com/KevinBlandy/notes.git) Java · 140 lines

13 document - id

14 -------------------------

15 # �ڼ����в����ĵ�ʱ������û�����ֶ����������Ӵ���_id���ֶ����ƣ���MongoDB���Զ�����һ��Object id�ֶ�

16 {"_id": ObjectId("xxxxxxxxx")}

17

OperatorDaoImpl.java (https://github.com/sun0x00/RedTorch.git) Java · 118 lines

14 import com.alibaba.fastjson.JSON;

15

16 import xyz.redtorch.common.mongo.MongoDBClient;

17 import xyz.redtorch.node.db.MongoDBClientService;

26

27 @Autowired

28 private MongoDBClientService mongoDBClientService;

29

30 private MongoDBClient managementDBClient;

33 @Override

34 public void afterPropertiesSet() throws Exception {

35 this.managementDBClient = mongoDBClientService.getManagementDBClient();

36 this.managementDBName = mongoDBClientService.getManagementDBName();

DefaultMessageListenerContainerUnitTests.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 297 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.messaging;

17

18 import static edu.umd.cs.mtc.TestFramework.*;

30

31 import org.springframework.dao.DataAccessResourceFailureException;

32 import org.springframework.data.mongodb.core.MongoTemplate;

33 import org.springframework.util.ErrorHandler;

34

CryptBinding.java (https://github.com/jyemin/mongo-java-driver.git) Java · 156 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.client.internal;

18

19 import com.mongodb.ReadPreference;

20 import com.mongodb.RequestContext;

21 import com.mongodb.ServerAddress;

22 import com.mongodb.ServerApi;

23 import com.mongodb.connection.ServerDescription;

SocketSettings.java (https://github.com/mebigfatguy/mongo-java-driver.git) Java · 291 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

19 import com.mongodb.ConnectionString;

20 import com.mongodb.annotations.Immutable;

21

22 import java.util.concurrent.TimeUnit;

119 * @return this

120 * @deprecated configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.

121 * @see <a href="https://docs.mongodb.com/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments">

122 * Does TCP keep-alive time affect MongoDB Deployments?</a>

206 * @return true if keep-alive is enabled.

207 * @deprecated configuring keep-alive has been deprecated. It now defaults to true and disabling it is not recommended.

208 * @see <a href="https://docs.mongodb.com/manual/faq/diagnostics/#does-tcp-keepalive-time-affect-mongodb-deployments">

209 * Does TCP keep-alive time affect MongoDB Deployments?</a>

WriteConcernException.java (https://github.com/foursquare/mongo-java-driver.git) Java · 129 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.BsonDocument;

DistinctIterableImpl.java (https://github.com/foursquare/mongo-java-driver.git) Java · 121 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import com.mongodb.client.DistinctIterable;

20 import com.mongodb.client.MongoCursor;

21 import com.mongodb.client.MongoIterable;

22 import com.mongodb.client.model.Collation;

23 import com.mongodb.operation.DistinctOperation;

AsyncConnection.java (https://github.com/mongodb/mongo-java-driver.git) Java · 224 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.MongoNamespace;

20 import com.mongodb.ReadPreference;

21 import com.mongodb.WriteConcernResult;

22 import com.mongodb.annotations.ThreadSafe;

23 import com.mongodb.async.SingleResultCallback;

MongoParametersParameterAccessorUnitTests.java (https://gitlab.com/javajamesb08/spring-data-mongodb.git) Java · 107 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.repository.query;

17

18 import static org.hamcrest.CoreMatchers.*;

27 import org.springframework.data.geo.Metrics;

28 import org.springframework.data.geo.Point;

29 import org.springframework.data.mongodb.core.mapping.MongoMappingContext;

30 import org.springframework.data.mongodb.core.query.TextCriteria;

31 import org.springframework.data.mongodb.repository.Person;

32 import org.springframework.data.repository.Repository;

33 import org.springframework.data.repository.core.RepositoryMetadata;

MongoRepositoryConfigurationExtensionUnitTests.java (https://gitlab.com/javajamesb08/spring-data-mongodb.git) Java · 116 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.repository.config;

17

18 import static org.junit.Assert.*;

26 import org.springframework.core.io.support.PathMatchingResourcePatternResolver;

27 import org.springframework.core.type.StandardAnnotationMetadata;

28 import org.springframework.data.mongodb.core.mapping.Document;

29 import org.springframework.data.mongodb.repository.MongoRepository;

AuditablePerson.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 70 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import java.util.Date;

21 import org.springframework.data.annotation.CreatedDate;

22 import org.springframework.data.annotation.Id;

23 import org.springframework.data.mongodb.core.mapping.DBRef;

24

25 /**

ReactiveAfterConvertCallback.java (git://github.com/SpringSource/spring-data-mongodb.git) Java · 44 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core.mapping.event;

17

18 import org.bson.Document;

SpringMongoDBConverter.java (https://gitlab.com/metamorphiccode/hazelcast-code-samples) Java · 85 lines

14 * limitations under the License.

15 */

16 package com.hazelcast.spring.mongodb;

17

18 import com.mongodb.BasicDBObject;

19 import com.mongodb.DBObject;

20 import com.mongodb.Mongo;

21 import org.bson.BSONObject;

22 import org.bson.types.ObjectId;

23 import org.springframework.data.mongodb.core.MongoTemplate;

24

25 import java.util.Date;

28

29 @SuppressWarnings("unused")

30 class SpringMongoDBConverter implements MongoDBConverter {

31

32 private MongoTemplate mongoTemplate;

CacheStoreSample.java (https://github.com/srecon/ignite-book-code-samples.git) Java · 164 lines

3 import com.blu.imdg.jdbc.PostgresDBStore;

4 import com.blu.imdg.jdbc.model.Post;

5 import com.blu.imdg.nosql.MongoDBStore;

6 import com.blu.imdg.nosql.model.MongoPost;

7 import java.time.LocalDate;

32 private static Logger LOGGER = LoggerFactory.getLogger(CacheStoreSample.class);

33 private static final String POSTGRESQL = "postgresql";

34 private static final String MONGODB = "mongodb";

35

36 /**

43 {

44 if(args.length <= 0 ){

45 LOGGER.error("Usages! java -jar .\\target\\cache-store-runnable.jar postgresql|mongodb");

46 System.exit(0);

47 }

DealerController.java (https://github.com/Microsoft/PartsUnlimitedMRP.git) Java · 201 lines

31 {

32 //Fix this line in Application Performance Monitoring HOL from 1000 to 1

33 int numMongoDBCalls = 100000;

34

35 try

38 List<DealerInfo> dealers = getRepository().getDealers();

39

40 while(count < numMongoDBCalls - 1)

41 {

42 dealers = getRepository().getDealers();

BasicDAO.java (https://github.com/jbyler/morphia.git) Java · 250 lines

5 import com.mongodb.WriteConcern;

6 import com.mongodb.WriteResult;

7 import org.mongodb.morphia.Datastore;

11 import org.mongodb.morphia.query.Query;

12 import org.mongodb.morphia.query.QueryResults;

13 import org.mongodb.morphia.query.UpdateOperations;

216

217 /* (non-Javadoc)

218 * @see org.mongodb.morphia.DAO#findOne(org.mongodb.morphia.query.Query)

219 */

220 public T findOne(final Query<T> q) {

230

231 /* (non-Javadoc)

232 * @see org.mongodb.morphia.DAO#find(org.mongodb.morphia.query.Query)

233 */

234 public QueryResults<T> find(final Query<T> q) {

HealthIndicatorAutoConfiguration.java (https://gitlab.com/luyuwww/spring-boot.git) Java · 259 lines

55 import org.springframework.context.annotation.Bean;

56 import org.springframework.context.annotation.Configuration;

57 import org.springframework.data.mongodb.core.MongoTemplate;

58 import org.springframework.data.redis.connection.RedisConnectionFactory;

59

SimpleMongoClientDatabaseFactoryUnitTests.java (https://github.com/spring-projects/spring-data-mongodb.git) Java · 110 lines

14 * limitations under the License.

15 */

16 package org.springframework.data.mongodb.core;

17

18 import static org.assertj.core.api.Assertions.*;

28

29 import org.springframework.aop.framework.AopProxyUtils;

30 import org.springframework.data.mongodb.MongoDatabaseFactory;

31 import org.springframework.test.util.ReflectionTestUtils;

32

33 import com.mongodb.ConnectionString;

34 import com.mongodb.client.ClientSession;

35 import com.mongodb.client.MongoClient;

36 import com.mongodb.client.MongoDatabase;

EstimatedDocumentCountOperation.java (https://github.com/jyemin/mongo-java-driver.git) Java · 127 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.internal.operation;

18

19 import com.mongodb.MongoCommandException;

20 import com.mongodb.MongoNamespace;

21 import com.mongodb.connection.ConnectionDescription;

22 import com.mongodb.internal.async.SingleResultCallback;

23 import com.mongodb.internal.binding.AsyncReadBinding;

ResourcePropertyOptions.java (https://github.com/lmco/streamflow.git) Java · 196 lines

21 import java.io.Serializable;

22 import java.util.ArrayList;

23 import org.mongodb.morphia.annotations.Embedded;

24

25 @Embedded

ESValuesHandler.java (git://github.com/Graylog2/graylog2-server.git) Java · 91 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog.storage.elasticsearch6.views.searchtypes.pivot.buckets;

AbstractConstructibleBson.java (git://github.com/mongodb/mongo-java-driver.git) Java · 132 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal.client.model;

17

18 import com.mongodb.annotations.Immutable;

ObjectIdElementTest.java (https://github.com/cazacugmihai/mongodb-async-driver.git) Java · 257 lines

1 /*

2 * #%L

3 * ObjectIdElementTest.java - mongodb-async-driver - Allanbank Consulting, Inc.

4 * %%

5 * Copyright (C) 2011 - 2014 Allanbank Consulting, Inc.

19 */

20

21 package com.allanbank.mongodb.bson.element;

22

23 import static org.easymock.EasyMock.createMock;

38 import org.junit.Test;

39

40 import com.allanbank.mongodb.bson.Element;

41 import com.allanbank.mongodb.bson.ElementType;

42 import com.allanbank.mongodb.bson.Visitor;

43

44 /**

MainWindow.java (http://mongodb-shell.googlecode.com/svn/trunk/) Java · 125 lines

1 package org.smartapp.mongodb.ui;

2

3 import java.awt.BorderLayout;

14 import javax.swing.JTabbedPane;

15

16 import org.smartapp.mongodb.config.ConnectionConfig;

17 import org.smartapp.mongodb.console.Console;

18 import org.smartapp.mongodb.console.TextAreaConsoleImpl;

19

20 import com.mongodb.Mongo;

35 public MainWindow() {

36

37 super("mongodb-shell " + VERSION);

38

39 console = new TextAreaConsoleImpl();

Util.java (https://github.com/jyemin/mongo-java-driver.git) Java · 77 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

14 * limitations under the License.

15 */

16 package com.mongodb.internal.client.model;

17

18 import com.mongodb.Function;

19 import com.mongodb.client.model.search.FieldSearchPath;

20 import com.mongodb.client.model.search.SearchPath;

25 import java.util.Iterator;

26

27 import static com.mongodb.assertions.Assertions.fail;

28

29 public final class Util {

CommandResult.java (https://github.com/foursquare/mongo-java-driver.git) Java · 97 lines

1 /*

2 * Copyright (c) 2008-2014 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb;

18

19 import org.bson.BsonDocument;

20

21 import static com.mongodb.DBObjects.toDBObject;

22 import static com.mongodb.assertions.Assertions.notNull;

25 * A simple wrapper to hold the result of a command. All the fields from the response document have been added to this result.

26 *

27 * @mongodb.driver.manual reference/command/ Database Commands

28 */

29 public class CommandResult extends BasicDBObject {

ClusterId.java (https://github.com/jyemin/mongo-java-driver.git) Java · 112 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.connection;

18

19 import com.mongodb.internal.VisibleForTesting;

20 import org.bson.types.ObjectId;

21

22 import static com.mongodb.assertions.Assertions.notNull;

23 import static com.mongodb.internal.VisibleForTesting.AccessModifier.PRIVATE;

24

25 /**

26 * A client-generated identifier that uniquely identifies a connection to a MongoDB cluster, which could be sharded, replica set,

27 * or standalone.

28 *

ListCollectionsPublisherImplTest.java (https://github.com/jyemin/mongo-java-driver.git) Java · 72 lines

1 /*

2 * Copyright 2008-present MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.reactivestreams.client.internal;

18

19 import com.mongodb.ReadPreference;

20 import com.mongodb.internal.operation.ListCollectionsOperation;

21 import com.mongodb.reactivestreams.client.ListCollectionsPublisher;

27 import reactor.core.publisher.Flux;

28

29 import static com.mongodb.reactivestreams.client.MongoClients.getDefaultCodecRegistry;

30 import static java.util.Arrays.asList;

31 import static java.util.concurrent.TimeUnit.SECONDS;

Dumpster.java (https://bitbucket.org/jochristo/dumpster-springboot-2.0.git) Java · 177 lines

18 import org.joko.core.jsonapi.annotations.JAPIType;

19 import org.joko.core.jsonapi.serializers.JsonDateFormatSerializer;

20 import org.mongodb.morphia.annotations.Entity;

21 import org.springframework.data.annotation.Id;

22 import org.springframework.data.mongodb.core.mapping.Document;

23 import org.springframework.data.mongodb.core.mapping.Field;

24

25 /**

PutDocumentHandler.java (https://github.com/SoftInstigate/restheart.git) Java · 157 lines

1 /*-

2 * ========================LICENSE_START=================================

3 * restheart-mongodb

4 * %%

5 * Copyright (C) 2014 - 2020 SoftInstigate

19 * =========================LICENSE_END==================================

20 */

21 package org.restheart.mongodb.handlers.document;

22

23 import io.undertow.server.HttpServerExchange;

29 import org.restheart.exchange.OperationResult;

30 import org.restheart.handlers.PipelinedHandler;

31 import org.restheart.mongodb.db.DocumentDAO;

32 import org.restheart.mongodb.utils.ResponseHelper;

SupportedSearchVersionFilter.java (https://github.com/Graylog2/graylog2-server.git) Java · 80 lines

4 * This program is free software: you can redistribute it and/or modify

5 * it under the terms of the Server Side Public License, version 1,

6 * as published by MongoDB, Inc.

7 *

8 * This program is distributed in the hope that it will be useful,

13 * You should have received a copy of the Server Side Public License

14 * along with this program. If not, see

15 * <http://www.mongodb.com/licensing/server-side-public-license>.

16 */

17 package org.graylog2.storage;

PhpTypeProviderUtil.java (https://github.com/Haehnchen/idea-php-generics-plugin.git) Java · 196 lines

176 * We can have multiple types inside a TypeProvider; split them on "|" so that we dont get empty types

177 *

178 * #M#x#M#C\FooBar.get?doctrine.odm.mongodb.document_manager.getRepository|

179 * #M#x#M#C\FooBar.get?doctrine.odm.mongodb.document_manager.getRepository

DistinctIterable.java (git://github.com/mongodb/mongo-java-driver.git) Java · 60 lines

1 /*

2 * Copyright 2015 MongoDB, Inc.

3 *

4 * Licensed under the Apache License, Version 2.0 (the "License");

15 */

16

17 package com.mongodb.async.client;

18

19

35 * @param filter the filter, which may be null.

36 * @return this

37 * @mongodb.driver.manual reference/method/db.collection.find/ Filter

38 */

39 DistinctIterable<TResult> filter(Bson filter);

53 * @param batchSize the batch size

54 * @return this

55 * @mongodb.driver.manual reference/method/cursor.batchSize/#cursor.batchSize Batch Size

56 */

57 DistinctIterable<TResult> batchSize(int batchSize);

DebeziumMongodbResource.java (https://github.com/apache/camel-quarkus.git) Java · 75 lines

26 import org.eclipse.microprofile.config.Config;

27

28 @Path("/debezium-mongodb")

29 @ApplicationScoped

30 public class DebeziumMongodbResource extends AbstractDebeziumResource {

33 Config config;

34

35 public DebeziumMongodbResource() {

36 super(Type.mongodb);

68 return Type.mongodb.getComponent() + ":localhost?"

69 + "offsetStorageFileName=" + offsetStorageFileName

70 + "&mongodbUser=" + config.getValue(Type.mongodb.getPropertyUsername(), String.class)

71 + "&mongodbPassword=" + config.getValue(Type.mongodb.getPropertyPassword(), String.class)

72 + "&mongodbName=docker-rs"

73 + "&mongodbHosts=" + hostname + ":" + port;

TicketRegistryProperties.java (https://github.com/Jasig/cas.git) Java · 144 lines

13 import org.apereo.cas.configuration.model.support.jpa.ticketregistry.JpaTicketRegistryProperties;

14 import org.apereo.cas.configuration.model.support.memcached.MemcachedTicketRegistryProperties;

15 import org.apereo.cas.configuration.model.support.mongo.ticketregistry.MongoDbTicketRegistryProperties;

16 import org.apereo.cas.configuration.model.support.quartz.ScheduledJobProperties;

17 import org.apereo.cas.configuration.model.support.redis.RedisTicketRegistryProperties;

64

65 /**

66 * MongoDb registry settings.

67 */

68 @NestedConfigurationProperty

69 private MongoDbTicketRegistryProperties mongo = new MongoDbTicketRegistryProperties();

70

71 /**

MongoDbTicketRegistryTicketCatalogConfiguration.java (https://github.com/Jasig/cas.git) Java · 74 lines

18

19 /**

20 * This is {@link MongoDbTicketRegistryTicketCatalogConfiguration}.

21 *

22 * @author Misagh Moayyed

26 @ConditionalOnFeatureEnabled(feature = CasFeatureModule.FeatureCatalog.TicketRegistry, module = "mongo")

27 @AutoConfiguration

28 public class MongoDbTicketRegistryTicketCatalogConfiguration extends BaseTicketDefinitionBuilderSupportConfiguration {

29

30 public MongoDbTicketRegistryTicketCatalogConfiguration(

31 final ConfigurableApplicationContext applicationContext,

32 final CasConfigurationProperties casProperties,

33 @Qualifier("mongoDbTicketCatalogConfigurationValuesProvider")

34 final CasTicketCatalogConfigurationValuesProvider configProvider) {

35 super(casProperties, configProvider, applicationContext);

AggregatePipelineService.java (https://github.com/my-dlq/blog-example.git) Java · 157 lines

3 import lombok.extern.slf4j.Slf4j;

4 import org.springframework.data.domain.Sort;

5 import org.springframework.data.mongodb.core.MongoTemplate;

6 import org.springframework.data.mongodb.core.aggregation.Aggregation;

7 import org.springframework.data.mongodb.core.aggregation.AggregationOperation;

8 import org.springframework.data.mongodb.core.aggregation.AggregationResults;

9 import org.springframework.data.mongodb.core.query.Criteria;

10 import org.springframework.stereotype.Service;

11 import javax.annotation.Resource;