Skip to content

Instantly share code, notes, and snippets.

@baio
Created June 22, 2012 13:36
Show Gist options
  • Save baio/2972769 to your computer and use it in GitHub Desktop.
Save baio/2972769 to your computer and use it in GitHub Desktop.
db.system.namespaces.find({name :/\.tourism\.\w{2,3}\.\d$/}).forEach(function (obj){
var name = obj.name.replace(/[^.]*\./i, "");
/*
db[name].ensureIndex({checkin : 1, nights : 1, uprice : 1, stars : 1});
print(db[name].count());
*/
db[name].find().forEach(function(obj1){
db.tourism.full.save(obj1);
}
);}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment