Go beyond simple match queries with these new query operators.
$eq: Equal to$noteq: Not equal to$in: In a list$notin: Not in a list$gt: Greater than$gte: Greater than or equal to$lt: Less than$lte: Less than or equal to$exists: Key exists$type: Match against type$like: String pattern match (as PostgreSQL LIKE)$regex: Regex match (as PostgreSQL ~)articles.find({
'upvotes': {
'$gte': 4,
'$lt': 10
},
'authorId': 'abcd',
'metadata': {
'$exists': True
}
})
articles.find({
"title": {
"$regex": "^.*Elixir.*$"
}
})
conferences.find({
"city": {
"$notin": ["London", "Glasgow"]
}
})
sort and skip params for find_one
The find_one operation now accepts optional skip and sort parameters, just like its sister-operation, find.
collection.find_one(
{"title": {"$like": "%Ruby%"}},
sort=[{'upvotes': -1}],
skip=2
)
$created and $updated sort optionsInternally, BedquiltDB keeps track of when documents are created and updated. Now, you can sort by these hidden fields.
# returns documents in order of the time they were created
collection.find({...}, sort=[{'$created': 1}])
# returns documents in order of the time they were updated
collection.find({...}, sort=[{'$updated': 1}])
remove_many_by_ids operation
A glaring oversight, corrected. Enjoy bulk removal of documents via a list of _id values
widgets.remove_many_by_ids(
["5c3b9277812c6a6752b2aff7",
"6697e90ceb808d6161aee879",
"9707b283e98a456e1e1f6b85",
"f3d177f0be545430cb517d6f"]
)
Getting started with BedquiltDB is now even easier, with the bedquiltdb/bedquiltdb Docker image.
The BedquiltDB Docs have been overhauled and updated, including an updated Guide
Presuming this whole "internet" thing catches on, people will be thrilled with the new BedquiltDB Website