From 5c218caa348f044e6570a4727e8248e860101487 Mon Sep 17 00:00:00 2001 From: Jeanne Gabrielle Taruc Date: Tue, 27 Jun 2023 09:29:30 -0700 Subject: [PATCH] added support for MongoDB collation --- index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.js b/index.js index 2007274..9e4b4a6 100644 --- a/index.js +++ b/index.js @@ -1531,6 +1531,12 @@ var cursorTransformsMap = { $batchSize: function(cursor, size) { return cursor.batchSize(size); }, + $collation: function(cursor, value) { + if (typeof value !== 'object') return null; + // The locale attribute is mandatory + if (!value.locale) return null; + return cursor.collation(value); + }, $comment: function(cursor, text) { return cursor.comment(text); },