Skip to main content
Version: 1.2.0

MongoDb example

from featurestore import Client, MongoDbCollection

# Initialise feature store client
client = Client("ip:port")
client.auth.login()

# Set project specifics
project = client.projects.create("demo")

# Create the jdbc source
mongo_db_source = MongoDbCollection("mongodb+srv://some_cluster.mongodb.net/test", database="sample_guides", collection="planets")
schema = client.extract_schema_from_source(mongo_db_source)

# Register the feature set
my_feature_set = project.feature_sets.register(schema, "feature_set_name", primary_key="_id")

# Quick look on the data
my_feature_set.get_preview()

Feedback