Skip to content

Commit a7e3218

Browse files
committed
Merge pull request #128 from 10gen/INT-506-limit-vs-size
INT-605 limit vs size
2 parents 1c724d4 + c7edb2c commit a7e3218

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

src/home/collection.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ var SamplingMessageView = require('../sampling-message');
77
var MongoDBCollection = require('../models/mongodb-collection');
88
var SampledSchema = require('../models/sampled-schema');
99
var app = require('ampersand-app');
10-
1110
var $ = require('jquery');
11+
var _ = require('lodash');
1212
var debug = require('debug')('scout:home:collection');
1313

1414
require('bootstrap/js/modal');
@@ -102,9 +102,9 @@ var MongoDBCollectionView = View.extend({
102102
this.schema.ns = this.model._id = ns;
103103
debug('updating namespace to `%s`', ns);
104104
this.schema.reset();
105-
this.schema.fetch({
105+
this.schema.fetch(_.assign({}, app.volatileQueryOptions.serialize(), {
106106
message: 'Analyzing documents...'
107-
});
107+
}));
108108
this.model.fetch();
109109
},
110110
onQueryChanged: function() {

src/models/query-options.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var Query = require('mongodb-language-model').Query;
66
var DEFAULT_SORT = {
77
$natural: -1
88
};
9-
var DEFAULT_LIMIT = 100;
9+
var DEFAULT_SIZE = 100;
1010
var DEFAULT_SKIP = 0;
1111

1212
var getDefaultQuery = function() {
@@ -32,9 +32,9 @@ module.exports = Model.extend({
3232
return DEFAULT_SORT;
3333
}
3434
},
35-
limit: {
35+
size: {
3636
type: 'number',
37-
default: DEFAULT_LIMIT
37+
default: DEFAULT_SIZE
3838
},
3939
skip: {
4040
type: 'number',
@@ -59,7 +59,7 @@ module.exports = Model.extend({
5959
this.set({
6060
query: getDefaultQuery(),
6161
sort: DEFAULT_SORT,
62-
limit: DEFAULT_LIMIT,
62+
size: DEFAULT_SIZE,
6363
skip: DEFAULT_SKIP
6464
});
6565
this.trigger('reset', this);

src/models/sampled-schema.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ module.exports = Schema.extend({
6464
* Take another sample on top of what you currently have.
6565
*
6666
* @example
67-
* schema.fetch({limit: 100});
67+
* schema.fetch({size: 100});
6868
* // schema.documents.length is now 100
69-
* schema.more({limit: 100});
69+
* schema.more({size: 100});
7070
* // schema.documents.length is now 200
71-
* schema.more({limit: 10});
71+
* schema.more({size: 10});
7272
* // schema.documents.length is now 210
7373
* @param {Object} options - Passthrough options.
7474
*/

src/sampling-message/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ var SamplingMessageView = View.extend({
4444
is_sample: {
4545
deps: ['schema_sample_size'],
4646
fn: function() {
47-
return this.schema_sample_size === app.queryOptions.limit;
47+
return this.schema_sample_size === app.queryOptions.size;
4848
}
4949
},
5050
sample_size_message: {

0 commit comments

Comments
 (0)