Commit 40a1e5df356b2b3fc01afde3a7e83622b04f7e7d

Authored by Tai Tran
1 parent c53b96440d
Exists in master

[optimize] don't get each collection

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

extract-mongo-schema.js
... ... @@ -163,17 +163,17 @@ var getSchema = function(url, opts) {
163 163 }
164 164 }
165 165  
166   - collectionInfos.map(function(collectionInfo, index) {
167   - var collectionData = {};
168   - collections[collectionInfo.collectionName] = collectionData;
169   - collectionData["collection"] = db.collection(collectionInfo.collectionName);
170   - });
  166 + // collectionInfos.map(function(collectionInfo, index) {
  167 + // var collectionData = {};
  168 + // collections[collectionInfo.collectionName] = collectionData;
  169 + // collectionData["collection"] = db.collection(collectionInfo.collectionName);
  170 + // });
171 171  
172 172 collectionInfos.map(function(collectionInfo, index) {
173 173 collectionData = collections[collectionInfo.collectionName];
174 174 var docSchema = {};
175 175 schema[collectionInfo.collectionName] = docSchema;
176   - var cur = wait.forMethod(collectionData["collection"], "find", {}, { limit: opts.limit });
  176 + var cur = wait.forMethod(collectionInfo, "find", {}, { limit: opts.limit });
177 177 var docs = wait.forMethod(cur, "toArray");
178 178 docs.map(function(doc) {
179 179 getDocSchema(collectionInfo.collectionName, doc, docSchema);