Skip to content

Instantly share code, notes, and snippets.

@acidsound
Created December 6, 2013 02:39
Show Gist options
  • Save acidsound/7817721 to your computer and use it in GitHub Desktop.
Save acidsound/7817721 to your computer and use it in GitHub Desktop.
table 검색용. mongoimport -d frs -c alltables --type csv --file ALL_TABLES-표\ 1.csv --headerline 로 밀어넣고 마구 검색
Alltables = new Meteor.Collection('alltables');
if (Meteor.isClient) {
Meteor.subscribe('Alltables');
Template.tables.tables=function() {
return Session.get("wd") && Alltables.find({
$or:[
{TABLE_PHYSICAL:RegExp(Session.get('wd'))},
{TABLE_LOGICAL:RegExp(Session.get('wd'))},
{COLUMN_PHYSICAL:RegExp(Session.get('wd'))},
{COLUMN_LOGICAL:RegExp(Session.get('wd'))}
]
}, {
$sort:{TABLE_PHYSICAL:1, COLUMN_ID:1}
});
}
Template.tables.events({
'submit' : function () {
Session.set('wd', $('.wd').val());
return false;
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment