Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Can't Do any queries, but i can in the console. #106

Open
PatrickOfRubiconRealm opened this issue Dec 9, 2015 · 4 comments
Open

Can't Do any queries, but i can in the console. #106

PatrickOfRubiconRealm opened this issue Dec 9, 2015 · 4 comments

Comments

@PatrickOfRubiconRealm
Copy link

Terms.find is not a function
at ReactMeteor.createClass.getMeteorState (terms.cjsx.coffee?74088d56821338029b2cb45b8109b45608090075:16)
at enqueueMeteorStateUpdate (ReactMeteor.js:52)
at ReactMeteor.js:19
at Tracker.Computation._compute (tracker.js:294)
at new Tracker.Computation (tracker.js:210)
at Object.Tracker.autorun (tracker.js:533)
at ReactMeteorMixin.componentWillMount (ReactMeteor.js:9)
at 43.ReactCompositeComponentMixin.mountComponent (react-with-addons-0.13.0.js:6847)
at 82.ReactPerf.measure.wrapper as mountComponent
at Object.89.ReactReconciler.mountComponent (react-with-addons-0.13.0.js:14720)

@froatsnook
Copy link
Contributor

How do you define Terms?

@PatrickOfRubiconRealm
Copy link
Author

Like this:

@Terms = new Meteor.Collection('terms')

Schemas.Terms = new SimpleSchema(

content:
type: String
autoform:
afFieldInput:
type: "textarea"
rows: 60

createdAt:
type: Date
autoValue: ->
if this.isInsert
new Date()

effectiveDate:
type: Date
autoValue: ->
if this.isInsert
new Date()
)

Terms.attachSchema Schemas.Terms
Meteor.subscribe('terms') if (Meteor.isClient)

(thanks)

@PatrickOfRubiconRealm
Copy link
Author

My bad... i think this was that i forgot a subscribe

@froatsnook
Copy link
Contributor

I think it must be something else. If you don't subscribe then it will just never return any documents. But Terms.find should still be a function.

Which file is Terms defined in? Is it defined in the root of the file? Or on Meteor.startup? Or something else?

But never mind if it already works. If so, feel free to close the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants