Comments (1)
You are fine!. With findOne instead find I get the follow error:
But. Why is not possible I use findOne?, I want to find a single document, should be possible use it appropriately named findOne.
I self answer the question: Publications need return a cursor (find), not a object (findOne).
According with meteor documentation (http://docs.meteor.com/#/full/findone)
findOne is Equivalent to find(selector, options).fetch()[0] with options.limit = 1.
So I change the code in publications/posts.js to:
Meteor.publish('posts.single', function (postId) {
check(postId, String);
const selector = {_id: postId};
// here the change
const options = {limit: 1};
return Posts.find(selector, options);
//
});
It works! and I think that it is more efficient :)
from mantra-sample-blog-app.
Related Issues (20)
- MUI leeds to Uncaught Invariant Violation
- storybook fails with unmodified repo, and with meteor 1.3.2.4 HOT 5
- jsdom error on npm test HOT 3
- FlowRouter SSR don't work properly HOT 1
- Git project description demo URL needs updating HOT 1
- Meteor.uuid is deprecated and untrusted on the client side HOT 5
- Failed to parse SourceMap: http://localhost:3000/packages/5b3...a10.map HOT 2
- Comments on naming variables
- Unable to resolve some modules: lib/collections HOT 3
- broken link at top of https://github.com/mantrajs/mantra-sample-blog-app HOT 1
- why not testing server code with wallaby?
- In container file,Where is the arguments of composer function comes from? HOT 4
- Why fetch in composer? HOT 6
- How to check authenticated routes? HOT 1
- no .meteor.com anymore HOT 1
- Cannot Deploy to Galaxy from Mac (Due to binary NPM modules in dev dependencies) HOT 6
- how to bind some arg to all actions ? HOT 1
- loading component HOT 2
- This fails on my system with storybook (app and tests its ok) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mantra-sample-blog-app.