Skip to main content

SuperDuper MongoDB is a Python library that provides a high-level API for working with MongoDB. It is built on top of pymongo and provides a more user-friendly interface for working with MongoDB.

Project description

superduper_mongodb

SuperDuper MongoDB is a Python library that provides a high-level API for working with MongoDB. It is built on top of pymongo and provides a more user-friendly interface for working with MongoDB.

In general the MongoDB query API works exactly as per pymongo, with the exception that:

  • inputs are wrapped in Document
  • additional support for vector-search is provided
  • queries are executed lazily

Installation

pip install superduper_mongodb

API

Class Description
superduper_mongodb.data_backend.MongoDataBackend Data backend for MongoDB.
superduper_mongodb.metadata.MongoMetaDataStore Metadata store for MongoDB.
superduper_mongodb.query.MongoQuery A query class for MongoDB.
superduper_mongodb.query.BulkOp A bulk operation for MongoDB.
superduper_mongodb.artifacts.MongoArtifactStore Artifact store for MongoDB.

Connection examples

Connect to mongomock

from superduper import superduper
db = superduper('mongomock://test')

Connect to MongoDB

from superduper import superduper
db = superduper('mongodb://localhost:27017/documents')

Connect to MongoDB Atlas

from superduper import superduper
db = superduper('mongodb+srv://<username>:<password>@<cluster-url>/<database>')

Query examples

Inserts

db['my-collection'].insert_many([{'my-field': ..., ...}
    for _ in range(20)
]).execute()

Updates

db['my-collection'].update_many(
    {'<my>': '<filter>'},
    {'$set': ...},
).execute()

Selects

db['my-collection'].find({}, {'_id': 1}).limit(10).execute()

Vector-search

Vector-searches may be integrated with .find.

db['my-collection'].like({'img': <my_image>}, vector_index='my-index-name').find({}, {'img': 1}).execute()

Read more about vector-search here.

Deletes

db['my-collection'].delete_many({}).execute()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

superduper_mongodb-0.6.0.tar.gz (19.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

superduper_mongodb-0.6.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file superduper_mongodb-0.6.0.tar.gz.

File metadata

  • Download URL: superduper_mongodb-0.6.0.tar.gz
  • Upload date:
  • Size: 19.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for superduper_mongodb-0.6.0.tar.gz
Algorithm Hash digest
SHA256 56337db5d03158490bad9a989662e2b08b8ade2e29a239db2dd0f86d6c9d090a
MD5 73a6e24de377a3a5cb44d43c978f40e3
BLAKE2b-256 5982bfb3de8934c70178b27a3290d6d4e9b8e649a9ace1918d803c86bba23ea6

See more details on using hashes here.

Provenance

The following attestation bundles were made for superduper_mongodb-0.6.0.tar.gz:

Publisher: release_plugins.yaml on superduper-io/superduper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file superduper_mongodb-0.6.0-py3-none-any.whl.

File metadata

File hashes

Hashes for superduper_mongodb-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 eb715d3e913efb085a0f6123b1cef5a608285455933a460319d5a5ba22abacd3
MD5 5f34a72a1147ade4998261ff6efdef25
BLAKE2b-256 da94366e0bcebb035693e8f853d1fae9fc42f3856e1e06fdaf4d481672061803

See more details on using hashes here.

Provenance

The following attestation bundles were made for superduper_mongodb-0.6.0-py3-none-any.whl:

Publisher: release_plugins.yaml on superduper-io/superduper

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page