Class MongoComplexUtilities
Object
MongoComplexUtilities
This class contains utilities methods for dealing with MongoDB complex features.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic Feature
extractFeature
(Object feature, String jsonPath) static Feature
extractFeature
(Feature feature, String jsonPath) Method for extracting or casting a feature from the provided object.findMappings
(DBCursor cursor) Compute the mappings for a mongodb cursor(iterator), this can be used to create a feature mapping.findMappings
(DBObject dbObject) Compute the mappings for a mongo db object, this can be used to create a feature mapping.static Object
getValue
(DBObject mongoObject, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object the value that correspond to the given json path.static Object
getValue
(DBObject mongoObject, Map<String, Integer> collectionsIndexes, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object the value that correspond to the given json path.static Object
Will try to extract from the provided object the value that correspond to the given json path.static Object
getValues
(DBObject dbObject, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object all the values that correspond to the given json path.static Object
Will try to extract from the provided object all the values that correspond to the given json path.static String
resolvePath
(Feature feature, String jsonPath) Concat the parent path if it exists to the provided JSON path.static void
setParentPath
(Feature feature, String parentPath) Store the parent path in a feature user data map.
-
Field Details
-
MONGO_PARENT_PATH
- See Also:
-
-
Method Details
-
resolvePath
Concat the parent path if it exists to the provided JSON path. -
setParentPath
Store the parent path in a feature user data map. -
getValue
Will try to extract from the provided object the value that correspond to the given json path. -
extractFeature
-
extractFeature
Method for extracting or casting a feature from the provided object. -
getValue
public static Object getValue(DBObject mongoObject, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object the value that correspond to the given json path. If the path contain a nested list of values an exception will be throw. -
getValue
public static Object getValue(DBObject mongoObject, Map<String, Integer> collectionsIndexes, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object the value that correspond to the given json path. The provided collections indexes will be used to select the proper element for the collections present in the path. -
getValues
Will try to extract from the provided object all the values that correspond to the given json path. -
getValues
public static Object getValues(DBObject dbObject, String jsonPath, Supplier<GeometryCoordinateSequenceTransformer> transformer) Will extract from the mongo db object all the values that correspond to the given json path. If the path contains nested collections the values from all the branches will be merged. -
findMappings
Compute the mappings for a mongo db object, this can be used to create a feature mapping. -
findMappings
Compute the mappings for a mongodb cursor(iterator), this can be used to create a feature mapping. This method will close the cursor.
-