On this page
The PolyDocument
object in the Polypheny JDBC Multimodel Extension serves as a representation of a document in a document-based result within the Polypheny environment. It extends the PolyMap
class, inheriting its functionality while specifying its type as ProtoValueType.DOCUMENT
.
Constructors
Constructor with Map Parameter
public PolyDocument(Map<PolyString, PolyValue> value)
Creates a new PolyDocument
object from a given map of PolyString
and PolyValue
pairs.
Parameters:
Parameter | Type | Description |
---|---|---|
value |
Map<PolyString, PolyValue> |
The key-value pairs representing the document |
Constructor with Single Key-Value Pair
public PolyDocument(PolyString key, PolyValue value)
Creates a new PolyDocument
object with a single key-value pair.
Parameters:
Parameter | Type | Description |
---|---|---|
key |
PolyString |
The key representing a field in the document |
value |
PolyValue |
The value associated with the key |
You can treat a PolyDocument
object like a Map<PolyString, PolyValue>
, enabling you to easily iterate over its keys and values, among other operations.
Usage:
PolyDocument document = PolyDocument.ofDocument(someMap);
for (Map.Entry<PolyString, PolyValue> entry : document.entrySet()) {
// Process each key-value pair in the document
}
© Polypheny GmbH. All Rights Reserved.