Database
42 results found
-
$sort should allow 0 as argument meaning "no sort"
The $sort operator and aggregation stage should allow 0 (possibly also null) as an argument for the field sort order, meaning, "Don't sort."
This allows a variable to be passed in that can conditionally skip the sort operation, in addition to the present specification, in which a variable can only choose ascending or descending sort.1 vote -
Feature to perform Machine Learning predictive analysis and classification in MongoDB
I want to bring the machine learning compute and predictive analysis into MongoDB atlas. Instead of ETL my data out of Atlas to achieve this, I will reduce my architectural complexity by having an aggregation operator that does this on my documents stored in Atlas.
1 vote -
Add Relaxed mode support for the $out operator
Add Relaxed mode support for the $out operator.
*and include as option in the existing drivers1 vote -
Aggregations should allow an empty sort stage instead of returning an error
When you run an aggregation pipeline that contains an empty sort stage (like
{"$sort": {}}
) MongoDB returns the error message "$sort stage must have at least one sort key". It would be really helpful if such a stage would work and simply not apply any sorting at all.For one this would be more consistent with a find operation (e.g.
db.runCommand({"find": "test", "sort": {}})
ordb.test.find({}, {}, {"sort": {}})
) which does not return an error but simply does not sort the results. More importantly it would also make it easier for developers and frameworks to dynamically generate the…1 vote -
Make $merge support DELETE operation
Currently, the
$merge
only supports insert/update/upsert/merge behaviour. It would be great to support delete behaviour. A common use case would be in-place document deduplication/clean-up in a collection.1 vote -
Sorting support on Array fields.
Presently, I'm attempting to arrange(sort) the documents within my collection based on a key nested within an array object. However, sorting isn't functioning as expected in this scenario.
A proper explanation with example is here what I mean.
https://www.mongodb.com/community/forums/t/how-to-sort-documents-in-collection-on-basis-of-array-fields/270867?u=samrat_n_a1 vote -
support parallel query executions include find(), aggregation()
To use multi-core environment and enhance the query performance w/ a large amount of documents, need a parallel execution.
Sharding or microsharding is not an alternative in this case.3 votes -
JSON
I'm converting a lot of data for export from MongoDB -> Postgresql
I would like an aggregation function to convert an object to JSON
{
"$addField": {
"_id": true,
"json": {
'$convert': {
'input': '$subdocument',
'to': 'json', # // Idealy, +1 for msgpack https://msgpack.org/
}
}
}
}thus object.json would be a STRING "{abc: true}"
FYI: Postgresql supports JSON(B) in it's field structures: https://www.postgresql.org/docs/current/datatype-json.html
1 vote -
define the random seed manually, for $rand and $sample
It will be great if an additional paramater to define the seed for $rand and $sample could be use.
2 votes -
Flatten arrays in group stage
Have group operators to flatten document arrays into a single one with or without repeated elements.
So ->
doc1 = {arr: [1,2,3,4], gr: "group"}, doc2 = {arr: [5, 6, 7, 8], gr: "group"}
{$group: {id: "$gr", arrays: {$***: "$arr"} } }
=>
{id: "gr", arrays: [1, 2, 3, 4, 5, 6, 7, 8]}2 votes -
$group all fields
$group should have the ability to allow specifying all fields in a document (without explicitly defining them all, which can lead to duplicating dozens of lines just to do "key: $first")
This will help users that use $unwind and then want to $group the results without having to do a subsequent $lookup and $mergeObjects (or similar) to get the final document structure they're looking for.
1 vote -
$merge
Report number of docs matched, merged, skipped, etc. from a $merge stage. Alternatively, return the merged doc results as a pipeline result to pass to additional stages.
3 votes -
Support compound/multiple grouping keys in $bucket
We often need to compute statistical/summarizing aggregations grouped by more than one field where all fields are of a $bucket-able type.
An example, would be to count all orders grouped by their status and some custom time ranges of their creation date.
This can be achieved by using $group in combination with a $switch expression (sometimes simplified with $trunc), however, that is cumbersome and prevents efficient grouping since e.g. no binary search can be employed to identify the bucket boundaries efficiently.The query syntax of $bucket would not need to change much. It would simply need to allow for nested…
6 votes -
Add operator that would calculate distance between 2 geolocation points
It would be great to have operator that would calculate distance between 2 geolocation points, and not to do it manually with big aggregate queries.
I suggest to add 2 new operators that would calculate distance in two different ways, as discussed in this Community Post: https://www.mongodb.com/community/forums/t/how-to-calculate-distance-between-two-geolocation-points/173045
19 votes -
Handle Daylight Saving Time when $densify is used on a date field
When using "day" as "unit" for a $densify pipeline stage on a date field, the date is always advanced of 24 hours. This is however not always the expected result in timezones in which the year has one 23-hour and one 25-hour long day, because of Daylight Saving Time.
It would be useful to have the possibility to pass an optional timezone parameter in the $densify stage and, when present, have the stage account for these exceptions when appropriate.
Here follows an example.
Assume we have a collection containing the following documents:
…db.densifyDateExample.insertMany([ {_id: "a", d: ISODate("2022-10-28T22:00:00Z")}, {_id: "b", d:
7 votes -
geo
It would be nice to get the length of an LineString of a geo-json object or the possibility to write an aggregation to calculate it.
2 votes -
Add SHA2, SHA3 and ECDSA functions to agg framework
It is very useful (and valuable security-wise) to be able to reverify hashes and signatures "on-engine" instead of dragging material out to a client app and running the algo there. The implementations are straightforward and everywhere now so it's not a huge lift for the backend. Example use:
aggregate([
{$match: whatever},
{$addFields: {
hashok: {$cond: [ {$eq: [ {$sha3: "path.to.struct"}, "path.to.stored.sha3"} ], 1, 0},
sigok: { $verify: { sig: "path.to.sig", pubkey: "path.to.pubkey", algo: "name of curve to use eg. SECP256k1}}
}
])
The digest function would operate on the raw BSON behind the scenes.1 vote -
Document scoped RBAC - Permission for collection document fields
Roles and accesses can be defined on the basis of collections that define roles for users.
It would be nice if these access permissions could be made within the scope of the fields under the collection and the query results would be returned accordingly.Current:
privileges: [
{ resource: { db: "users", collection: "user" }, actions: [ "find"] },
}
Expected:
{ resource: { db: "users", collection: "user", field: "email" }, actions: [ "find"] },
3 votes -
Improve the mongo query language
Sometimes I find Mongo query language as not put very well together, sometimes it feels like a patch job. It would be nice, if you could make you query language easier to reason about. It would be awesome, if you could introduce fluent style api builder instead of building bson documents.
1 vote -
Add functionality to specify the readConcern level at db.collection.findOne()
Add functionality to specify the readConcern at db.collection.findOne(). At the version 5.0.14 it's not supported.
1 vote
- Don't see your idea?