From https://www.mongodb.com/docs/manual/core/gridfs/
GridFS uses two collections to store files. One collection stores the file chunks, and the other stores file metadata. The section GridFS Collections describes each collection in detail.
You should access your files via the GridFS API
To store and retrieve files using GridFS, use either of the following:
A MongoDB driver. See the drivers documentation for information on using GridFS with your driver.
The mongofiles command-line tool. See the mongofiles reference for documentation.
As long as I understand you deleted data from one collection, so your bucket data is not cosistent.
That's the reason why you get the error from RESTHeart
The mongo driver finds the metadata (stored in mybucket.files
) but not the chunks (stored in mybucket.chunks
)
mybucket.files
have the corresponding documents in mybucket.chunks
The 6.3.0 release introduces a few bug fixes and some important security enhancements:
✅ Add new security interceptor bruteForceAttackGuard
(defends from brute force attacks by returning "429 Too Many Requests" when failed auth attempts in the last 10 seconds from the same IP are more than 50%)
✅ Upgrade undertow to v2.2.16.Final
✅ Add WildcardInterceptor that allows intercepting requests to any service
✅MongoRealmAuthenticator can check the password field on user document updates and reject it when it is too weak
✅ Ensure that the defined auth mechanisms are executed in the correct order
✅ filterOperatorsBlacklist is now enabled by default with blacklist = [ "$where" ] (prevents code injections at the database level)
✅ Fix error message in case of var not bound in aggregation and MongoRequest.getAggregationVars() method name
✅ Fix CORS headers for request OPTIONS /bucket.files/_size
✅ Set default MongoDB connections minSize=0
✅ Allow specifying ReadConcern, WriteConcern and ReadPreference at the request level
myProdDB.Orders
. So an aggregate query would look like: myProdDB.Orders.aggregate([])
GET /coll/_meta
What's coll
, what's _meta
? Where are these in relation to myProdDB.Orders
?PUT /coll HTTP/1.1
in the Examples. What's coll
here? In which db is it?mongo-mounts:
- what: myProdDB/Orders
where: /prod/orders
/prod/orders
. So you need to add the aggregation to the collection properties and you do it withPATCH /prod/orders
{
"aggrs": [
{
"stages": [
{ "$match": { "name": { "$var": "n" } } },
{ "$group": { "_id": "$name", "avg_age": { "$avg": "$age" } } }
],
"type": "pipeline",
"uri": "example-pipeline"
}]
}
GET /prod/orders/_meta
. This would return your aggrs
metadata