CosmosDB migration MERN-Can't read collections

Dev, MERN apps 96 Reputation points
2020-11-06T05:06:38.903+00:00

I'm exporting a database from mlabs to CosmosDb.

after failing with other methods, I finally exported via mongodump and imported into CosmosDb. I can read the collections in studio 3t.

but when connecting in Express/mongoose via the connectionString, the collections all return [].

I've added my IP to the firewall.

It's not the code, when I point back to the mlab db everything retrieves correctly.

what am I missing in CosmosDb?

using:
"mongodb": "^3.0.4",
"mongoose": "^5.0.6",

router.get('/',function(req,res,next){
var ret={};
var query={"businessCode" : 'Travis'};//req.decoded.businessCode};
var cursor=db.collection('lookup').find(query).toArray(function(err,items){
if (err){
next (err);
} else {
//items = [] ...should definately return a collection
console.log ('****** items', items);
}
})
});

Azure Cosmos DB
Azure Cosmos DB

An Azure NoSQL database service for app development.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.