Skip to content

Commit

Permalink
Request only file names & urls in annotated images callback
Browse files Browse the repository at this point in the history
  • Loading branch information
brucechou1983 committed Nov 8, 2018
1 parent 3ac8057 commit 44979b3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion imports/navigator/SseAllAnnotated.jsx
Expand Up @@ -54,7 +54,7 @@ class SseAllAnnotated extends React.Component {

export default withTracker(() => {
Meteor.subscribe("sse-labeled-images");
const all = SseSamples.find({$where: 'this.objects && this.objects.length>0'}).fetch();
const all = SseSamples.find({file: {"$exists": true}}).fetch();
const grouped = new MapSet();
all.forEach(im =>{grouped.map(im.folder, im)});
const imagesCount = all.length;
Expand Down
2 changes: 1 addition & 1 deletion imports/navigator/SseNavigatorApp.jsx
Expand Up @@ -126,7 +126,7 @@ class SseNavigatorApp extends React.Component {

export default withTracker((props) => {
Meteor.subscribe("sse-labeled-images");
const annotated = SseSamples.find({$where: 'this.objects && this.objects.length>0'}).fetch();
const annotated = SseSamples.find({file: {"$exists": true}}).fetch();
let urlMap = new Map();
annotated.forEach(o => urlMap.set(decodeURIComponent(o.url), true));
return {urlMap};
Expand Down
5 changes: 4 additions & 1 deletion lib/collections.js
Expand Up @@ -9,7 +9,10 @@ if (Meteor.isServer) {
});

Meteor.publish("sse-labeled-images", function () {
return SseSamples.find({$where: 'this.objects && this.objects.length>0'});
return SseSamples.find(
{$where: 'this.objects && this.objects.length>0'},
{fields: {file: 1, url: 1}},
);
});

Meteor.publish('sse-props', function () {
Expand Down

0 comments on commit 44979b3

Please sign in to comment.