Ottoman Created Meta().id

What would be the best fix for this issue?

I have records created by Ottoman (2.0.0-alpha.12) who’s meta ids is in this format:
_default$_default::43bbed97-d6b3-4bbf-b0a5-e9b60d4fbdf7.

I assume the default prefix signifies scope and collection.

After upgrading to Ottoman (2.0.0-alpha.18) the meta id is now
User::e6d40fb3-a0ac-4c22-80e9-1a7ed681f1a8

The prefix is now the Model Name.

Due to this change when I perform Model.findById()/updateById(), records with the ‘default’ prefix no longer works. Newly created records work just fine.

What options would I have to fix this issue for the older data created in 2.0.0-alpha.12? I’m assuming I will just have to recreate these records as meta ids are immutable but I thought I’d ask.

Thanks for your help.

Hello @vlimjap great question, yes we made this change recently but you can still work with the old documents by overriding the keygenerator function

const keyGenerator = ({metadata}) => `${metadata.scope}$${metadata.collection}`

The only caveat is that you cannot work with the newer documents. Basically it can work one way .
Hope this helps

You can also reach out to us on our GitHub issues page as well Issues · couchbaselabs/node-ottoman · GitHub