public class MongodbSchemaUtils extends Object
The schema can be acquired in two modes: SPECIFIED and DYNAMIC. In the SPECIFIED mode, the schema details are provided explicitly, while in the DYNAMIC mode, the schema is inferred from the first document in the collection.
Constructor and Description |
---|
MongodbSchemaUtils() |
Modifier and Type | Method and Description |
---|---|
static Schema |
getMongodbSchema(org.apache.flink.configuration.Configuration mongodbConfig)
The schema can be created in one of the two modes:
SPECIFIED: In this mode, the schema is created based on the explicit column
names provided in the configuration.
|
public static Schema getMongodbSchema(org.apache.flink.configuration.Configuration mongodbConfig)
The Configuration object passed to the createSchema method should have the necessary MongoDB configuration properties set, including the host address, database name, collection name, and optionally, the username and password for authentication. For the SPECIFIED mode, the field names should also be specified in the configuration.
Copyright © 2023–2024 The Apache Software Foundation. All rights reserved.