java.lang.Object
net.pincette.mongo.Util
Some utilities.
- Since:
- 1.3.2
- Author:
- Werner Donné
-
Method Summary
Modifier and TypeMethodDescriptionstatic intCompares two values according to thestatic StringescapeFieldName(String name) static JsonObjectfromMongoDB(JsonObject json) Unescapes field names that were escaped for MongoDB.static JsonObjecttoMongoDB(JsonObject json) Escapes field names that don't work in MongoDB.static StringunescapeFieldName(String name)
-
Method Details
-
compare
Compares two values according to the- Parameters:
v1- the first value.v2- the second value.- Returns:
- Returns a negative value if
v1is smaller thanv2, a positive value ifv1is larger thanv2and 0 otherwise. - Since:
- 1.3.2
-
escapeFieldName
-
fromMongoDB
Unescapes field names that were escaped for MongoDB.- Parameters:
json- the given JSON object.- Returns:
- The unescaped JSON object.
- Since:
- 4.1
- See Also:
-
toMongoDB
Escapes field names that don't work in MongoDB. Dots, dollar signs and slashes are replaced with "_dot_", "_dollar_" and "_slash_" respectively.- Parameters:
json- the given JSON object.- Returns:
- The escaped JSON object.
- Since:
- 4.1
-
unescapeFieldName
-