UUID for key on insert

Is there a way to have Couchbase automatically assign a UUID when doing an insert through the node sdk? I’ve tried importing UUID from couchbase and that didn’t seem to work. Just wondering if I need to generate the UUID and use it in the key position of if there’s a way to let couchbase know that I want it autogenerated like specifying key::#UUID# with a cbimport call.

Thanks

1 Like

Hey @justinbkay,

You can import the node-uuid library to generate UUID’s, and then use those in your inserts. Couchbase does not prescribe any specific or special requirements for our keys and thus you are free to use any form you wish.

Cheers, Brett

1 Like