Ticket: Migration Problem

The following query runs correctly when I do it in mongodb atlas but returns 0 documents when i run it on my console

predicate  { lastupdated: { '$exists': true, '$type': 'string' } } 
projection  { lastupdated: 1 }

$node movie-last-updated-migration.js

Found 0 documents to update
No documents to update

My connection is working correctly, the cursor is an empty array [ ] , I don’t know why it is unable to find the required documents

I am also getting the same error. Please let me know if you find solution.

You have to copy values of MFLIX_DB_URI, MFLIX_NS from .env file and set them to host and namespace respectively
The migration js file is run in isolation and hence these values won’t be available in process.env object.

1 Like

Thank you @chinta_14978, I had not set the MFLIX_NS

Hi did it work for you when you set MFLIX_NS, there is no namespace declared. where does it go?

Hi @Melakeselam_Moges_Mengistu_42275,

Is the code not working for you even after setting MFLIX_NS? Let me know so that I can help.