Tabnine Logo
AbstractMongoRepository.decode
Code IndexAdd Tabnine to your IDE (free)

How to use
decode
method
in
de.otto.edison.mongo.AbstractMongoRepository

Best Java code snippets using de.otto.edison.mongo.AbstractMongoRepository.decode (Showing top 6 results out of 315)

origin: de.otto.edison/edison-mongo

public V create(final V value, final long maxTime, final TimeUnit timeUnit) {
  final K key = keyOf(value);
  if (key != null) {
    final Document doc = encode(value);
    collectionWithWriteTimeout(maxTime, timeUnit).insertOne(doc);
    return decode(doc);
  } else {
    throw new NullPointerException("Key must not be null");
  }
}
origin: de.otto.edison/mongo

public V create(final V value) {
  Document doc = encode(value);
  collection().insertOne(doc);
  return decode(doc);
}
origin: otto-de/edison-microservice

public V create(final V value, final long maxTime, final TimeUnit timeUnit) {
  final K key = keyOf(value);
  if (key != null) {
    final Document doc = encode(value);
    collectionWithWriteTimeout(maxTime, timeUnit).insertOne(doc);
    return decode(doc);
  } else {
    throw new NullPointerException("Key must not be null");
  }
}
origin: de.otto.edison/edison-mongo

public V createOrUpdate(final V value, final long maxTime, final TimeUnit timeUnit) {
  final Document doc = encode(value);
  collectionWithWriteTimeout(maxTime, timeUnit)
      .replaceOne(byId(keyOf(value)), doc, new UpdateOptions().upsert(true));
  return decode(doc);
}
origin: otto-de/edison-microservice

public V createOrUpdate(final V value, final long maxTime, final TimeUnit timeUnit) {
  final Document doc = encode(value);
  collectionWithWriteTimeout(maxTime, timeUnit)
      .replaceOne(byId(keyOf(value)), doc, new ReplaceOptions().upsert(true));
  return decode(doc);
}
origin: de.otto.edison/mongo

public V createOrUpdate(final V value) {
  final K key = keyOf(value);
  final Document existing = collection().find(byId(key)).first();
  Document doc = encode(value);
  if (existing != null) {
    collection().replaceOne(byId(key), doc);
  } else {
    collection().insertOne(doc);
  }
  return decode(doc);
}
de.otto.edison.mongoAbstractMongoRepositorydecode

Javadoc

Decode a MongoDB Document into a value.

Popular methods of AbstractMongoRepository

  • byId
    Returns a query that is selecting documents by ID.
  • collection
  • encode
    Encode a value into a MongoDB Document.
  • findOne
    Find a single value with the specified key, if existing.
  • keyOf
    Returns the key / identifier from the given value. The key of a document must never be null.
  • matchAll
    Returns a query that is selecting all documents.
  • collectionWithWriteTimeout
  • create
  • createOrUpdate
  • createOrUpdateBulk
  • delete
    Deletes the document identified by key.
  • deleteAll
    Deletes all documents from this repository.
  • delete,
  • deleteAll,
  • ensureIndexes,
  • findAll,
  • findAllAsStream,
  • getFindIterable,
  • size,
  • toStream,
  • update

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now