BSON field 'listCollections.collation' is an unknown field

Hi Everybody,
I just started having this weird issue with my db.createCollection calls. The collation I am using is valid. I am not using the listCollections though the createCollection method likely does. I am using the following call:

db.createCollection(collectionName, {
    collation: {
        locale: 'en_US',
        strength: 2
MongoError: BSON field 'listCollections.collation' is an unknown field.
at MessageStream.messageHandler (C:\projectsjs\fourmatic\node_modules\mongodb\lib\cmap\connection.js:261:20)
    at MessageStream.emit (events.js:209:13)
    at MessageStream.EventEmitter.emit (domain.js:476:20)
    at processIncomingData (C:\projectsjs\fourmatic\node_modules\mongodb\lib\cmap\message_stream.js:144:12)
    at MessageStream._write (C:\projectsjs\fourmatic\node_modules\mongodb\lib\cmap\message_stream.js:42:5)
    at doWrite (_stream_writable.js:428:12)
    at writeOrBuffer (_stream_writable.js:412:5)
    at MessageStream.Writable.write (_stream_writable.js:302:11)
    at TLSSocket.ondata (_stream_readable.js:722:22)
    at TLSSocket.emit (events.js:209:13) {
  ok: 0,
  code: 40415,
  codeName: 'Location40415',
  '$clusterTime': {
    clusterTime: Timestamp { _bsontype: 'Timestamp', low_: 3, high_: 1647996433 },
    signature: { hash: [Binary], keyId: [Long] }
  operationTime: Timestamp { _bsontype: 'Timestamp', low_: 3, high_: 1647996433 },
  name: 'MongoError'

What could be causing this issue?

I realized the error occurs when the collections are created with the collation option otherwise the error does not occur. But creating the collections with the collation option is a requirement: all collections being suitable for case-insensitive operations by default is our use-case.

Can anyone let me know why this issues just suddenly started happening with the collation option?

Migrating to the latest version of mongdb node driver corrected the issue. I am assuming certain breaking changes recently occurred in the mongodb engine which caused the node driver to become out of sync with the engine.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.