spencercarli / react-native-meteor-boilerplate

MIT License
628 stars 139 forks source link

Fetching data from database #56

Closed Jorrit2002 closed 8 years ago

Jorrit2002 commented 8 years ago

Could someone explain how I fetch data from meteor? In Details.js data is fetched but presented using the MeteorListView. I'd like to just print the fetched data in the console but I can't figure out how to do that. The handle doesn't contain any objects.

export default createContainer(() => {
  const handle = Meteor.subscribe('details-list');
  return {
    detailsReady: handle.ready(),
  };
}, DetailsContainer);
spencercarli commented 8 years ago

To publish the data in the console you could run Meteor.collection('details').find() which will return an array of objects once the subscription has completed.

Be sure to check out the react-native-meteor docs for more info!