Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bdfd441641 | ||
|
|
4c7d5ff46d |
No files matched your search
@@ -8,18 +8,18 @@ helpers for the common paths, with a raw escape hatch for everything else.
|
||||
`requirements.txt`:
|
||||
|
||||
```
|
||||
mongo @ git+ssh://git@git.rethinkstudios.io/rethink-public/mongo.git@v1.0.0
|
||||
mongo @ git+ssh://git@git.rethinkstudios.io/rethink-public/mongo.git@v1.2.0
|
||||
```
|
||||
|
||||
Direct:
|
||||
|
||||
```bash
|
||||
pip install "mongo @ git+ssh://git@git.rethinkstudios.io/rethink-public/mongo.git@v1.0.0"
|
||||
pip install "mongo @ git+ssh://git@git.rethinkstudios.io/rethink-public/mongo.git@v1.2.0"
|
||||
```
|
||||
|
||||
Requires `motor` and `pymongo` (pulled transitively).
|
||||
|
||||
Drop the `@v1.0.0` suffix from the line above to install the latest unpinned.
|
||||
Drop the `@v1.2.0` suffix from the line above to install the latest unpinned.
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "mongo"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
description = "async mongodb wrapper over motor with a raw escape hatch"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
+2
-2
@@ -328,7 +328,7 @@ class MongoDB:
|
||||
"""replace a whole document, optionally upserting"""
|
||||
try:
|
||||
response = await self._db[collection].replace_one(target, document, upsert=upsert)
|
||||
return bool(response.matched_count or response.upserted_id)
|
||||
return response.matched_count > 0 or response.upserted_id is not None
|
||||
except Exception:
|
||||
log.exception("db.update_document() on %s", collection)
|
||||
return False
|
||||
@@ -382,7 +382,7 @@ class MongoDB:
|
||||
response = await self._db[collection].update_one(
|
||||
target, {"$set": updates}, upsert=True
|
||||
)
|
||||
return bool(response.matched_count or response.upserted_id)
|
||||
return response.matched_count > 0 or response.upserted_id is not None
|
||||
except Exception:
|
||||
log.exception("db.upsert_document_field() on %s", collection)
|
||||
return False
|
||||
|
||||
Reference in new issue
Block a user