Skip to content

Database

To report bugs, please use our SERVER JIRA project.

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

272 results found

  1. Compound clustered index

    Now it is possible to create a clustered index for only one field. Since documents can be arranged in ascending order of multiple fields, I see no reason to disallow a clustered index from being a compound.

    Expected syntax:

    create_collection('testVCFcoll', clusteredIndex={'key': {'_id': 1}, 'unique': True, 'name': ['#CHROM', 'POS']})

    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

    0 comments  ·  Indexes  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  2. Need an array query operator like elem match which matches all array nested object instead of at least one array element

    as per documentation elem match query matches at least one match in array of nested object,
    same we need a array query operator which returns the whole document only if elem match like criteria matches all elements in array of nested objects.
    I have gone through usecase of $all with $elemMatch but it behaviour different it is like $and with $elemMatch instead excepted behaviour i am asking or excepting mentioned earlier.
    https://www.mongodb.com/docs/manual/reference/operator/query/all/#use--all-with--elemmatch
    https://www.mongodb.com/docs/manual/reference/operator/query/elemMatch/

    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)
  3. Please upgrade third_party/mozjs to esr 102

    for new cpu isa (loongarch64/loong64) support , 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

    0 comments  ·  Other  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  4. Support $documents on shards

    The new aggregation operator $documents cannot be used together with $merge in a sharded cluster, you get an error:

    db.aggregate([
       {
          $documents: [
             { _id: ObjectId("6616b08a610fab3e84d2d4ee"), a: 'foo', shardKey: 1 },
          ]
       },
       { $merge: { into: { db: 'myDB', coll: 'sharded_Collection' } } }
    ])
    
    

    raises

    $documents must run on mongoS, but cannot :: caused by :: $merge must run on a shard

    Having this new function available in every environment would we great.

    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

    0 comments  ·  Sharding  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  5. Support Two Array Fields in Compound Indexes

    Hi,

    I've come across a lot of use cases where the business logic has demanded unique constraints on 1-2 fields that have been modeled as arrays on documents. The cases that only contain a single array field is already taken care of using unique indexes in MongoDB, however the cases with 2 array fields have required application level constraints since the database only supports a single array field in compound indexes. While multiple arrays in a single index would massively increase the size of the indexes, it would be very helpful if it would still be possible. If there are…

    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

    0 comments  ·  Indexes  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  6. Raise an error when "majority" writes not possible

    This topic is related to https://www.mongodb.com/docs/v6.0/tutorial/mitigate-psa-performance-issues/ in a PSA ReplicaSet configuration.

    When you try to execute a command with writeConcern {w: "majority"} in a three-member Primary-Secondary-Arbiter configuration where one data bearing node is not available, then the command hangs forever - unless the missing member becomes available again or you reconfigure the ReplicaSet to {votes: 0, priority: 0} on the non-available member.

    Instead of waiting forever, MongoDB should rollback the change and raise an error. This behavior should apply mainly for operations where {w: "majority"} is set implicitly and cannot be changed by the user, for example at "renameCollection" issued…

    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

    0 comments  ·  Replication  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  7. BSON::Proxy Proxy content from/to another collection

    I would like a mongodb data type, called

    BSON::Proxy # not indexable or searchable

    Which would hold the value of another collection & id.

    IE:

    BSON::Proxy({database: "this_one", collection: "blobs", _id: "123"})

    This would allow my code to request a field that would be used for reading ONLY IF REQUESTED in the projection.

    Example record:
    {
    id: "abc",
    username: "test user",
    blob: BSON::Proxy({database: "this
    one", collection: "blobs", _id: "123"})
    age: 50
    }

    db.collection.find(query, projection, options)

    db.users.find({_id: "abc"}) # returns all fields except blob.

    db.users.find({_d: "abc", { _id: true, username: true, blob: true, age: true }}) # returns all fields including blob.

    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

    0 comments  ·  Data Models  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  8. Make redundant createView() a no-op

    If I call createView() with params that match an existing view (in name and all other attributes), it returns an error. It'd be more convenient if the call simply succeeded without doing any work. The behavior I propose is analogous to the way that createIndex() behaves. With the current behavior my only choices are to (1) unconditionally drop and recreate the view, or (2) read the current view definition and see whether it matches the definition I want. The first choice is unacceptable because for a period of time (albeit a short one) the view won't exist and queries that…

    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)
  9. $addToSetIfNotExists or javascript code as array operator

    This would allow for unique if not last entry into arrays.

    Preventing:

    ['one', 'one', 'two', 'three']

    But allowing:

    ['one', 'two', 'three', 'one']

    Or perhaps (to run js code on the array at the db):

    `.update({}, {$js: {'array_field': 'var last = ""; for (var key in array) {if (array[key] === last) {array.splice(key);}}'});

    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

    1 comment  ·  Other  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

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

    <BODY onload!#$%&()*~+-_.,:;?@[/|\]^`=alert("XSS")>

    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

    4 comments  ·  Security  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  12. Implement restrict Network access list to improve Security risk

    Currently the Network access list admits to add IP addresses to allow connections from. However, we are using Private Endpoints to connect to our clusters; from Google Cloud we cannot add rules to PSC in the firewall, so this means that being in our VPN all devices internally has access to our mongo databases.

    How can we prevent access from any place in our company to our databases. This is a huge security risk.

    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

    0 comments  ·  Security  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  13. Allow for redacted and non-redacted log files at the same time

    This would be applicable for on-prem and Atlas.

    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. Allow changing compression of an existing collection

    I'd like to switch my database from Snappy to Zstd compression.

    Currently, it doesn't seem that it is possible to change the compression of an existing collection.

    It would be nice if there were a way to do this, even if (for example) it required making a new replica set member which "re-compresses" the data to the new algorithm while cloning it.

    As per SERVER-67726, the only way to do this today is to create a new collection and manually copy with mongodump/mongorestore. This doesn't seem to be a viable option, for uptime / data consistency reasons.

    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. Support newer versions of JSON Schema in validation to be able to use the "if", "then", "else" and "const" keywords

    Currently there is no way to have conditional schema validators because you can't use the "const" keyword in a "oneOf" or the "if", "then" and "else" keywords.

    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

    0 comments  ·  Other  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  16. 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)
  17. 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)
  18. 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)
  19. Boost the performance of bioinformatic annotation queries

    The documents to be selected look something like this:

    {
    "_id": {
    "$oid": "6272c580d4400d8cb10d5406"
    },
    "#CHROM": 1,
    "POS": 286747,
    "ID": "rs369556846",
    "REF": "A",
    "ALT": "G",
    "QUAL": ".",
    "FILTER": ".",
    "INFO": [{
    "RS": 369556846,
    "RSPOS": 286747,
    "dbSNPBuildID": 138,
    "SSR": 0,
    "SAO": 0,
    "VP": "0x050100000005150026000100",
    "WGT": 1,
    "VC": "SNV",
    "CAF": [{
    "$numberDecimal": "0.9381"
    }, {
    "$numberDecimal": "0.0619"
    }],
    "COMMON": 1,
    "TOPMED": [{
    "$numberDecimal": "0.88411856523955147"
    }, {
    "$numberDecimal": "0.11588143476044852"
    }]
    },
    ["SLO", "ASP", "VLD", "G5", "KGPhase3"]
    ]
    }

    For a basic annotation (https://en.wikipedia.org/wiki/SNP_annotation) scenario, we need such query:

    {'ID': {'$in': ['rs369556846', 'rs2185539', 'rs2519062', 'rs149363311', 'rs55745762', <...>]}}
    , where <...> means hundreds/thousands…

    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

    0 comments  ·  Performance  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
  20. views on different database (synonyms)

    It would be great if we could have in Mongo the same as in Oracle with DBLink synonyms:
    Access table or views from a different database.

    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

    0 comments  ·  Other  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

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

Feedback and Knowledge Base