File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
src/internal-packages/schema/lib/store Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 131131 "mongodb-js-metrics" : " ^1.5.0" ,
132132 "mongodb-language-model" : " ^0.3.3" ,
133133 "mongodb-ns" : " ^1.0.3" ,
134- "mongodb-schema" : " ^4.2.4 " ,
134+ "mongodb-schema" : " ^5.0.0 " ,
135135 "ms" : " ^0.7.1" ,
136136 "ncp" : " ^2.0.0" ,
137137 "numeral" : " ^1.5.3" ,
Original file line number Diff line number Diff line change 11const app = require ( 'ampersand-app' ) ;
22const Reflux = require ( 'reflux' ) ;
33const StateMixin = require ( 'reflux-state-mixin' ) ;
4- const Schema = require ( 'mongodb-schema' ) . Schema ;
4+ const schemaStream = require ( 'mongodb-schema' ) . stream ;
55const _ = require ( 'lodash' ) ;
66
77// stores
@@ -124,8 +124,8 @@ const SchemaStore = Reflux.createStore({
124124 } , 1000 ) ;
125125
126126 this . samplingStream = app . dataService . sample ( ns , options ) ;
127- const schema = new Schema ( ) ;
128- this . analyzingStream = schema . stream ( true ) ;
127+ this . analyzingStream = schemaStream ( ) ;
128+ let schema ;
129129
130130 const onError = ( ) => {
131131 this . setState ( {
@@ -178,12 +178,15 @@ const SchemaStore = Reflux.createStore({
178178 } ) ;
179179 }
180180 } )
181+ . on ( 'data' , ( data ) => {
182+ schema = data ;
183+ } )
181184 . on ( 'error' , ( analysisErr ) => {
182185 onError ( analysisErr ) ;
183186 } )
184187 . on ( 'end' , ( ) => {
185188 if ( ( numSamples === 0 || sampleCount > 0 ) && this . state . samplingState !== 'error' ) {
186- onSuccess ( schema . serialize ( ) ) ;
189+ onSuccess ( schema ) ;
187190 } else {
188191 return onError ( ) ;
189192 }
You can’t perform that action at this time.
0 commit comments