New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

superduper-mongodb

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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.

  • 0.5.0
  • PyPI
  • Socket score

Maintainers
1

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

  • Code
  • API-docs
ClassDescription
superduper_mongodb.data_backend.MongoDataBackendData backend for MongoDB.
superduper_mongodb.metadata.MongoMetaDataStoreMetadata store for MongoDB.
superduper_mongodb.query.MongoQueryA query class for MongoDB.
superduper_mongodb.query.BulkOpA bulk operation for MongoDB.
superduper_mongodb.artifacts.MongoArtifactStoreArtifact 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-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()

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc