Class Patch

java.lang.Object
net.pincette.mongo.Patch

public class Patch extends Object
Support for MongoDB updates.
Since:
2.1
Author:
Werner Donné
  • Method Details

    • updateOperators

      public static List<Bson> updateOperators(JsonObject original, JsonPatch patch)
      Creates a list of update operators from a JSON patch, with which a MongoDB document can be updated using a bulk write. Root paths are not supported. You can use a plain update for that.
      Parameters:
      original - the JSON object that will be updated.
      patch - the JSON patch.
      Returns:
      The generated aggregation pipeline.
      Since:
      2.1
    • updateOperators

      public static JsonArray updateOperators(JsonObject original, JsonArray patch)
      Creates an array of update operators from a JSON patch, with which a MongoDB document can be updated using a bulk write. Root paths are not supported. You can use a plain update for that.
      Parameters:
      original - the JSON object that will be updated.
      patch - the JSON patch.
      Returns:
      The generated aggregation pipeline.
      Since:
      2.1
    • updateOperators

      public static Stream<JsonObject> updateOperators(JsonObject original, Stream<JsonObject> patch)
      Creates a stream of update operators from a JSON patch, with which a MongoDB document can be updated using a bulk write. Root paths are not supported. You can use a plain update for that.
      Parameters:
      original - the JSON object that will be updated.
      patch - the JSON patch.
      Returns:
      The generated aggregation pipeline.
      Since:
      2.1