AdminKatya (Product Manager, Query, MongoDB)
My feedback
18 results found
-
2 votes
An error occurred while saving the comment AdminKatya (Product Manager, Query, MongoDB) supported this idea · -
1 vote
An error occurred while saving the comment Would using $$ROOT like this work:
{$group: {_id: '$groupkey', document: {$first: '$$ROOT'}}} ?If not, could you provide an example of the document and the pipeline that achieves the transformation (with the stages you mentioned). thank you
-
2 votesAdminKatya (Product Manager, Query, MongoDB) supported this idea ·
-
4 votes
An error occurred while saving the comment This is not likely to be supported any time soon. Change Streams report durable writes, in this case write didn't happen.
-
20 votes
An error occurred while saving the comment Still no ETA for this, but's it's on the roadmap
-
1 voteAdminKatya (Product Manager, Query, MongoDB) shared this idea ·
-
1 vote
An error occurred while saving the comment In MongoDB 6.0 there will be an ability to watch for views and indexes with showExpandedEvents option.
https://jira.mongodb.org/browse/SERVER-46414
There's nothing planned as of today regarding the users and roles.Could you tell a little bit more about your need for users and roles, what is the use case?
-
3 votes
An error occurred while saving the comment Expressions are not allowed because bounds have to be constant for the entire densification process. Potentially support for constant expressions can be added, e.g. range: {bounds: [{$dateTrunc: { date: ISODate("2022-05-13T07:00:00.000Z"), unit: "hour", binSize: 1 }}, ISODate("2022-05-20T07:00:00.000Z")], step: 1}. But something like this still will not be supported: range: {bounds: [{$dateTrunc: { date: '$dateFieldOne', unit: "hour", binSize: 1 }}, '$dateFieldTwo')], step: 1}
Would that work for your use case?
-
1 vote
An error occurred while saving the comment Thank you for the feedback!
While as of today $lookup still always produces an array, even if there's only one document found in the 'from' collection, starting MongoDB 5.0 you can use `localField` and `foreignField` with the `pipeline`, so $match is not necessary
https://docs.mongodb.com/manual/reference/operator/aggregation/lookup/#correlated-subqueries-using-concise-syntax
[
{
"$lookup": {
"from": "categories",
"localField": "category",
"foreignField": "_id",
"pipeline": [
{
"$project": {
"_id": 0,
"cat_name": "$category",
"cat_description": "$description"
}
}
],
"as": "category_details"
}
},
{
"$replaceRoot": {
"newRoot": {
"$mergeObjects": [
"$$ROOT",
{
"$first": "$category_details"
}
]
}
}
},
{
"$project": {
"category_details": 0
}
}
] -
2 votes
An error occurred while saving the comment How about aggregation with $merge? Would this achieve what you are looking for?
db.tasks.aggregate([
{$match: {
'user.id': '1234'
}},
{$lookup: {
from: 'users',
localField: 'user.id',
foreignField: '_id',
as: 'user',
pipeline: [{$set: {id: "$_id"}}, {$unset: "_id"}]
}},
{$set: {
user: {$first: '$user'}
}},
{$merge: {
into: 'tasks',
on: '_id'
}}
]) -
4 votes
An error occurred while saving the comment We recommend using Atlas Search for this https://docs.atlas.mongodb.com/atlas-search/. It supports multiple indexes.
-
2 votes
An error occurred while saving the comment I'm moving this request to Compass, since it seems that the request is about usability fo representation
An error occurred while saving the comment You can run explain() for your aggregation to see number of documents and execution time
db.collection.explain('executionStats').aggregate([...]) -
1 vote
An error occurred while saving the comment This feature is on the roadmap, however, the target release is not known yet.
-
1 vote
An error occurred while saving the comment Could you expand on this a little, why would this be preferred over adding a filter on unique field, e.g.
db.test.find({"creationDate" : {$gte:ISODate('2021-08-27T07:25:00Z')}, "_id" : {$gte: lastSeenId}).sort({"creationDate":1, _id: 1}).limit(20) -
1 vote
An error occurred while saving the comment (moved this request to the Database section)
You are correct, this would not work, `from` and `as` only accept static strings. There are no short-term plans to support this feature, it would require a revamp of the security model and query optimization.
A similar request is also tracked here https://jira.mongodb.org/browse/SERVER-22497
-
1 vote
An error occurred while saving the comment Hello, Arthur, could you provide more details, and describe the use case.
-
1 vote
An error occurred while saving the comment Hi Ali, in MongoDB 4.4 you can run JavaScript function inside the aggregation stage, so you can avoid the network roundtrip for each document. For example:
{$set: {
user: {
$function: {
arguments: ["$user"],
body: function(user) {
return JSON.parse(user);
},
language: 'js'
}
}
}}Also, there are $replaceOne and $replaceAll operators for strings, and $merge can now output to the same collection.
Release Notes: https://docs.mongodb.com/manual/release-notes/4.4/index.html#aggregation
-
3 votes
An error occurred while saving the comment Hi Julien, what kind of geometries do you store? 2d index only supports storing data as points.
This request is also tracked here https://jira.mongodb.org/browse/SERVER-16284