Skip to content

Database

To report bugs, please use our SERVER JIRA project.

  • Hot ideas
  • Top ideas
  • New ideas
  • My feedback

38 results found

  1. Allow Dynamic Object In $project and $addFields

    Assume I have a field mapping defined in some configuration collection of my application. And this field mapping varies for different clients on my application.

    I would like to pass the dynamic object in my $project or $addFields stage

    Like:

    $project: {
    {$arrayToObject: "$field_mapping"},
    }

    {$arrayToObject: "$field_mapping"} would return something like

    "email" : "$data.Email",
    "phone" : "$data.Phone,
    "firstname" : "$data.FirstName",
    "last
    name" : "$data.LastName",
    "preferredchannel" : "$data.Channel",
    "preferred
    language" : "$data.LanguageCode",
    "emailchannel" : "$data.Email",
    "sms
    channel" : "$data.SMS",
    "province" : "$data.CustomerState"

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  2. hint support for $graphLookup

    Currently you can supply a hint to the aggregation call in order to tell MongoDB to use a specific index for the initial $match. But there is currently no way to specify which index to use for a $graphLookup later in the pipeline.

    I would like an optional hint property on the $graphLookup stage.

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  3. 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

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. Create operators that support Centrality Algorithms use cases

    Degree Centrality
    Closeness Centrality
    Harmonic Centrality
    Betweenness Centrality
    Eigenvector Centrality
    PageRank
    ArticleRank

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  5. `$getField` to work with a dynamic `field`

    Currently $getField works only when field resolves at query-compile-time to a string. It would be nice if it worked also when field resolves to a string at runtime.

    See this Jira ticket - https://jira.mongodb.org/browse/SERVER-67030

    5 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  6. Add a $sample accumulator operator

    So that it's easier to sample a number of items from each group, instead of writing lengthy DSL like this:

    https://www.mongodb.com/community/forums/t/sample-x-number-of-documents-in-each-group-with-or-after-a-group-stage/170787

    Ideally it can be expressed like this:


    {
    $group: {
    _id: '$year',
    samples: { $sample: 100 },
    }
    }

    Hence making sampling 100 items from each group a snap to achieve!

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  7. kNN Searches with MongoDB

    Dear MongoDB team,
    The possibility for kNN searches within a collection would be a real game changer. Not only in machine learning, but also in other areas you need this query method to find similar structures.
    Practically, it could go in the same direction as text searches. So that you have to create an index that you can also query similarly and then sort according to the score.

    I speak from my own suffering, as I had to switch from MongoDB to Open-/Elasticsearch for my current project, as they are also non-relational databases but support kNN searches. However, I like…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  8. Support expressions in $densify range bounds

    The $densify aggregation pipeline stage seems unable to evaluate range bounds expressions, requiring the range bounds to be constant.

    See the following example (the collection testcoll contains a single documents with only the _id field):

    sometestdb> db.testcoll.aggregate([{$addFields: {a: 1}}, {$densify: {field: "a", range: {bounds: [0, 5], step: 1}}}])
    
    [
    
      { a: 0 },
    
      { _id: ObjectId("6284a16d64553eaf74b1e189"), a: 1 },
    
      { a: 2 },
    
      { a: 3 },
    
      { a: 4 }
    
    ]
    
    
    
    sometestdb> db.testcoll.aggregate([{$addFields: {a: 1}}, {$densify: {field: "a", range: {bounds: [{$toInt: "0"}, 5], step: 1}}}])
    
    MongoServerError: A bounding array must be an ascending array of either two dates or
    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  9. Raise the limit of 16 MB JSON between aggregation stages

    When doing analytics, the 16 MB JSON limit between aggregation stages restricts the ability to process large amount of data. allowDiskUse does not help with all the various $operators and stages that we use. See ticket 00774514 for details.

    7 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  10. Add option to $dayOfWeek to choose between Monday and Sunday

    Hi!

    I was wondering if you could add an optional parameter to $dayOfWeek that allows you to choose on which day you want the functionality to start counting.

    Thanks!

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  11. Add regex support in pipeline operator `replaceAll`

    It would be very nice to have something like this possible:

    { $replaceAll:
       { input: "$text", find: "/[;,.]/g", replacement: "." }
    }
    

    Many thanks !

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  12. the profile output in association with the $comment query operator need to have consistency across operations.

    I have observed the different profile result with regard to $comment query operator in association with find and update operation respectively as follows;

    • find operation shows a comment on the command.filter.$comment and the command.comment field in the system.profile collection.

      op: 'query',
      ns: 'db101.Bets',
      command: {
      find: 'Bets',
      filter: {
      _id: ObjectId("61a9db4b3bd34e4f68fb9abc"),
      '$comment': 'test-dba'
      },
      comment: 'test-dba',
      lsid: { id: UUID("43ebee67-3184-4ede-9cee-ecca7457861a") },
      '$db': 'db101'
      },

    • update operation shows a comment only on the command.q.$comment field in the system.profile collection.

      op: 'update',
      ns: 'db101.Bets',
      command: {
      q: {
      _id: ObjectId("61a9db4b3bd34e4f68fb9abc"),
      '$comment': 'test-dba'
      },
      u: { '$set': { odds: 0.5 } },
      multi:…

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  13. multiple centersphere as a geometry for geowithin

    im looking at one of my queries that a system regularly runs and some times we look for records that are within up to 250 different centerspheres, i wornder if we could enable, like geowithin has the ability to support multiple poligons, we could enable multiple centerspheres ,


    $match: {{'location':{
    "$geoWithin" : {
    "$centerSphere" : [[ 14.4321, -9.4321], 2.5232135647961246e-05]
    }
    }}, {'location':{
    "$geoWithin" : {
    "$centerSphere" : [[ 14.4321, -9.4321], 2.5232135647961246e-05]
    }
    }}, ...}

    we could do :
    ```
    $match: {'location':{
    "$geoWithin" : {
    "$centerSpheres" : [
    [[ 14.4321, -9.4321], 2.5232135647961246e-05] ,
    [[ 14.4321, -9.4321], 2.5232135647961246e-05],
    ...
    ]

        } 
    }}
    
    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  14. 1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  15. Provide straightforward syntax for 1-to-1 joins in aggregation

    The syntax for joins that bring back multiple documents from foreign collections is very straightforward and yields exactly what one would expect, but simple joins that are bread and butter in SQL require very convoluted and expensive to run syntax.

    Consider a product database that has products, categories and reviews collections. Each product has a unique category and may have multiple reviews. Getting all reviews in an aggregation is very straightforward (top stage), but getting categories, similar to SQL, is as convoluted as it gets (bottom stage).

    db.products.aggregate(
    [
        //
        // Document aggregates naturally aggregate foreign documents
        // into
    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  16. support $lookup for update aggregation

    We frequently denormalise either full documents or subsets to different documents in order to speed up reading, create indexes or paginate/sort on fields.

    Consider a user collection and a task collection, if a task can be assigned to the user, it makes sense to just put the user document on the task they are assigned. But an update to a user now requires you to update the user both in the user collection and all tasks with that user in the tasks collection.

    This can be achieved but does introduce some complexity, however the introduction of updates using aggregation pipelines…

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  17. geoContain

    Dear all,
    according to the attached image, I have some documents (in blue, with id from 1 to 5) having a geographic extent and a search area (in yellow).
    I need to find all documents where search area is completly inside the document's geometry.
    Using different words, I need to find all documents where geometry completly covers the given search area.
    In my sample, the geo query should return the document with id 1.
    This kind of query has a opposite logic than the $geoWithin

    Could you provide a $geoContain functionality in the next future?

    10 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  18. Allow configuration of 100mb memory limit per aggregation pipeline stage

    In this old thread from 2016 (https://groups.google.com/forum/#!topic/mongodb-user/LCeFZZRz5EY) it was asked whether there was a way to increase the 100mb in memory limit of each stage of an aggregation pipeline. The responses centered around two points:

    1. If too much memory is used per aggregation pipeline stage then it will reduce performance for the overall MongoDB database, impacting other queries negatively.
    2. You can set allowDiskUse: true and revert to performing these pipeline stages on disk when they exceed 100mb.

    I believe this subject needs to be revisited for the following reasons:

    1. “Too much memory” is very subjective, and the 100mb…
    26 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
2 Next →
  • Don't see your idea?

Feedback and Knowledge Base