Problem when attach on "aldeed:collection2-core"
See original GitHub issueI tried aldeed:collection2-core, simpl-schema2
, but have problem on Posts.attachSchema(Posts.schema)
import {Mongo} from 'meteor/mongo';
import SimpleSchema2 from 'simpl-schema';
// import { SimpleSchema } from 'meteor/aldeed:simple-schema';
const Posts = new Mongo.Collection('posts');
Posts.schema = new SimpleSchema2({
createdDate: {
type: Date,
},
title: {
type: String,
},
body: {
type: String,
},
});
Posts.attachSchema(Posts.schema);
export default Posts;
It show
Error: Invalid definition for pick field.
W20170329-10:07:49.304(7)? (STDERR) at packages/aldeed_simple-schema.js:1429:13
W20170329-10:07:49.304(7)? (STDERR) at Function._.each._.forEach (packages/underscore.js:147:22)
W20170329-10:07:49.304(7)? (STDERR) at [object Object].SimpleSchema (packages/aldeed_simple-schema.js:1426:5)
W20170329-10:07:49.304(7)? (STDERR) at [object Object].c2AttachSchema [as attachSchema] (packages/aldeed_collection2-core.js:62:10)
W20170329-10:07:49.305(7)? (STDERR) at meteorInstall.imports.api.posts.posts.js (imports/api/posts/posts.js:27:16)
W20170329-10:07:49.305(7)? (STDERR) at fileEvaluate (packages/modules-runtime.js:197:9)
W20170329-10:07:49.305(7)? (STDERR) at Module.require (packages/modules-runtime.js:120:16)
W20170329-10:07:49.305(7)? (STDERR) at Module.Mp.importSync (/Users/theara/.meteor/packages/modules/.0.9.0-beta.13.ag5gz5++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:88:16)
W20170329-10:07:49.306(7)? (STDERR) at meteorInstall.imports.api.posts.methods.js (imports/api/posts/methods.js:1:1)
W20170329-10:07:49.306(7)? (STDERR) at fileEvaluate (packages/modules-runtime.js:197:9)
And then I tried to remove Posts.attachSchema(Posts.schema);
, It work fine.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:27
Top Results From Across the Web
Attachment Error in Gmail - Quick FIX - YouTube
The files you want to attach to or download from an email do not attach or download. Sometimes, the problem lies not with...
Read more >"attach" instead of "start" issue - Visual Studio Feedback
I saved a project with a small amount of code onto a folder called "coding" in my documents folder. The next day i...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right now it’s possible to use another approach as described here:
{ friends: { type: Array }, 'friends.$': { type: String }, }
Actually, there mentioned that we can use{ friends: [String], }
but it doesn’t work.My problem turned out to be that, for some reason, when I added an unspecified version of collection2-core, I wound up with an older version. Per the advice of somebody in a different thread, I uninstalled all the old aldeed stuff, then did this:
meteor add aldeed:collection2-core@2.0.1
This fixed my problem.