Skip to content

Daniel

My feedback

1 result found

  1. 50 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

    started  ·  7 comments  ·  Atlas Search  ·  Admin →
    How important is this to you?

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)
    An error occurred while saving the comment
    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
    }
    }
    );
    }

    Daniel supported this idea  · 
    An error occurred while saving the comment
    Daniel commented  · 

    Is there any workaround?

Feedback and Knowledge Base