Add support for UUID datatypes in Atlas Search
Currently, UUID is not one of the supported datatypes for Atlas Search. This is a feature request to add support for UUID datatypes in Atlas Search.

-
Ben commented
I use UUIDs across various services and databases and for supporting public API interactions.
The implementation independence from Mongo and commoness in web apps makes them a valuable identifer tool and therefore I feel they should be supported within Mongos indexing capabilities.
I mean, if you can index a date object but not a UUID binary, then like .. wut?
It would be great to be able to track the progression of it, such as when we can expect to see it supported.. are we talking mongths or longer?
-
Daniel commented
Thank you @Erich!
For anyone who needs, here is a trigger to add the string version of UUID:
exports = async function (changeEvent) {
const doc = changeEvent.fullDocument;
const id = changeEvent.documentKey._id;
const searchId = id.toHex().replace(/^(.{8})(.{4})(.{4})(.{4})(.{12})$/, '$1-$2-$3-$4-$5');
const collection = ...;
collection
.updateOne(
{ _id: id },
{
$set: {
'searchId': searchId
}
}
);
} -
Erich commented
@Daniel, the only workaround I've found is to store a string version of the UUID and index that in your search index until this is supported. I wish this would get more focus as it's a real issue for my clients.
-
Daniel commented
Is there any workaround?
-
Sameer commented
What is the status of this? If this is being tracked, can someone link this to jira ticket please :)