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 131
131
"mongodb-js-metrics" : " ^1.5.0" ,
132
132
"mongodb-language-model" : " ^0.3.3" ,
133
133
"mongodb-ns" : " ^1.0.3" ,
134
- "mongodb-schema" : " ^4.2.4 " ,
134
+ "mongodb-schema" : " ^5.0.0 " ,
135
135
"ms" : " ^0.7.1" ,
136
136
"ncp" : " ^2.0.0" ,
137
137
"numeral" : " ^1.5.3" ,
Original file line number Diff line number Diff line change 1
1
const app = require ( 'ampersand-app' ) ;
2
2
const Reflux = require ( 'reflux' ) ;
3
3
const StateMixin = require ( 'reflux-state-mixin' ) ;
4
- const Schema = require ( 'mongodb-schema' ) . Schema ;
4
+ const schemaStream = require ( 'mongodb-schema' ) . stream ;
5
5
const _ = require ( 'lodash' ) ;
6
6
7
7
// stores
@@ -124,8 +124,8 @@ const SchemaStore = Reflux.createStore({
124
124
} , 1000 ) ;
125
125
126
126
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 ;
129
129
130
130
const onError = ( ) => {
131
131
this . setState ( {
@@ -178,12 +178,15 @@ const SchemaStore = Reflux.createStore({
178
178
} ) ;
179
179
}
180
180
} )
181
+ . on ( 'data' , ( data ) => {
182
+ schema = data ;
183
+ } )
181
184
. on ( 'error' , ( analysisErr ) => {
182
185
onError ( analysisErr ) ;
183
186
} )
184
187
. on ( 'end' , ( ) => {
185
188
if ( ( numSamples === 0 || sampleCount > 0 ) && this . state . samplingState !== 'error' ) {
186
- onSuccess ( schema . serialize ( ) ) ;
189
+ onSuccess ( schema ) ;
187
190
} else {
188
191
return onError ( ) ;
189
192
}
You can’t perform that action at this time.
0 commit comments