An Azure NoSQL database service for app development.
CosmosDB migration MERN-Can't read collections
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
2 answers
Sort by: Oldest
-
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
-
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