React Native Boiler Plate - returning data


#1

I’m using the react native boiler plate by Spencer Carli. https://github.com/spencercarli/react-native-meteor-boilerplate

I have two questions.

1)

My main question is how do I return data from a meteor collection into my app?

I’m attempting to change: Line 67

Goal:

instead of getting the total count of posts, I would like to return the title of the post.

Full Source Code

When I try and point to a title, all I get is a bunch of random ID’s instead of an object.

eg)
["EQ2dDufrMLenz6WNk","caYG5mDkZrGHqE9dJ","mTXvqYFCSfDjfREtc","fWxQrHKXxgCFvvfQo","t3tPnhzGcN8qsuf9H","ZBTPgFP8uF6abKwHR","Kr6T4Gngmc9SQe3G9","9GoZD2bw7LQcwecno","pRcfTPsTB3FdcGDSu","9DbR6WpxpNCEsvoZm","K7gNXmYkm6u6GyZ83","NcxPyzAjowHXAeC6A","Hmhefz8tE4Mb3euHp","xL3hw7prLCLi8LeNZ","ictdwZhkA84KA4Gig","LCtsvv58sfoPJReJP","ofXtvSiqbH8SNESpb","hfjgBRfKcZA6qx72t","zNKGPqP4ipGq79wpe","9N6gEDjdwpdu7tkZx","LHvEckicNSyWWG6wc","b4JXEsf8xLSvhtPfQ","SAYf6Av3PKoQxcxKo","vzLrrbEwJnB46cCu8","LECz4EMGoXkNzwTZd","ezMthoRyEkpWESnXB","gbgwLHLkuP8iSzBeq","neY4aGbSKFTkPMBb2","CcvpH65jC37tABwtL","WcpdCdn856JEr5Egu","jzLfqyzsYzLdBQZ8v","siSPpJSCWReXSAoKF","EQ5xL2Cwepe9XFWPP","DXQr5JPQpS6puSEvS","maSQNnLgZ63HeMHFR","cAAQQheuFshPJjPZn","h4Jauqwx9yLNh52Ad","YqJHvEkrRNQWSqX5o","QbHKcM2HvQu47EFS6","zvwk47nqXmwPZa67J","pRcQYc5TzeEet3C8T","MxKdTLEqfYaTQxh5k","KvMvK8NdkCk4Fbvg6","ThTDvfRQYfevSrcKp","EXNSLm6XtZMqhFFBh","hD9YGS6gfxE353gPZ","ETHs4Hfw9L5aekbd4","ELAc7ijQetN7JQTWN","DLnob4PFx6au3thme","FDgWTWcXvzRX49HNS","y5jys3vW8mpFBokRG","AhSDubS94BMdvxPkk","fckLJuDE5Zu8J2x3b","Re359NQMneYPDLbtB","FMM7mosXtNATzAojc","4P5DMkvDZbcZjup2k","L7fruiBSWEvrxa3Xh","hCcuEnqf729RjQ2dc","2932kzSAiAzx3TuqT","ruMWJQGsJMyKhoBm5"]

this.state.posts

05-26 15:56:42.717 2146 4454 I ReactNativeJS: Connected to DDP server. 05-26 15:56:42.855 2146 4454 I ReactNativeJS: {} 05-26 15:56:42.925 2146 4454 I ReactNativeJS: {} 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { name: 'posts', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: db: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { collections: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { posts: [Circular], 05-26 15:56:42.990 2146 4454 I ReactNativeJS: users: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { name: 'users', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: db: [Circular], 05-26 15:56:42.990 2146 4454 I ReactNativeJS: items: { k5WvF8oEHRgBgTmrv: { _id: 'k5WvF8oEHRgBgTmrv', _version: 1 } }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: versions: { k5WvF8oEHRgBgTmrv: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: version: 2 } }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: transaction: { db: [Circular], dirtyIds: {}, queued: false }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: posts: [Circular], 05-26 15:56:42.990 2146 4454 I ReactNativeJS: users: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { name: 'users', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: db: [Circular], 05-26 15:56:42.990 2146 4454 I ReactNativeJS: items: { k5WvF8oEHRgBgTmrv: { _id: 'k5WvF8oEHRgBgTmrv', _version: 1 } }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: versions: { k5WvF8oEHRgBgTmrv: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: version: 2 } }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: items: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { EQ2dDufrMLenz6WNk: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'EQ2dDufrMLenz6WNk', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: caYG5mDkZrGHqE9dJ: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'caYG5mDkZrGHqE9dJ', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post CuFqRgMT6hPzkzgYF', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: mTXvqYFCSfDjfREtc: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'mTXvqYFCSfDjfREtc', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post 5NDR6mHeioGtZHmsP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: fWxQrHKXxgCFvvfQo: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'fWxQrHKXxgCFvvfQo', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post YuwJmJ2AzkPZnXHm8', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: t3tPnhzGcN8qsuf9H: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 't3tPnhzGcN8qsuf9H', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post bDQCnJKp9uDwshkJL', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: ZBTPgFP8uF6abKwHR: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'ZBTPgFP8uF6abKwHR', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post ee2NC5FkYE9vyGo4B', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: Kr6T4Gngmc9SQe3G9: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'Kr6T4Gngmc9SQe3G9', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post ANfjeq3JGXMAeiRxu', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: '9GoZD2bw7LQcwecno': 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: '9GoZD2bw7LQcwecno', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post awrWY9saFuPt3DoaW', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: pRcfTPsTB3FdcGDSu: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'pRcfTPsTB3FdcGDSu', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post A7YEH9WWnfzS3Mbq6', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: '9DbR6WpxpNCEsvoZm': 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: '9DbR6WpxpNCEsvoZm', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post 3arf9u7q32A3TCBn3', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: K7gNXmYkm6u6GyZ83: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'K7gNXmYkm6u6GyZ83', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post C9Br3RrroYGXskTww', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: NcxPyzAjowHXAeC6A: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'NcxPyzAjowHXAeC6A', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: Hmhefz8tE4Mb3euHp: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'Hmhefz8tE4Mb3euHp', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: xL3hw7prLCLi8LeNZ: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'xL3hw7prLCLi8LeNZ', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: ictdwZhkA84KA4Gig: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'ictdwZhkA84KA4Gig', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: LCtsvv58sfoPJReJP: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'LCtsvv58sfoPJReJP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: ofXtvSiqbH8SNESpb: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'ofXtvSiqbH8SNESpb', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: hfjgBRfKcZA6qx72t: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'hfjgBRfKcZA6qx72t', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: zNKGPqP4ipGq79wpe: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'zNKGPqP4ipGq79wpe', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: '9N6gEDjdwpdu7tkZx': 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: '9N6gEDjdwpdu7tkZx', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post DiqEDwMmtLem9PZKP', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: LHvEckicNSyWWG6wc: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'LHvEckicNSyWWG6wc', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post fEJQQS3DctsF8bLLY', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: b4JXEsf8xLSvhtPfQ: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'b4JXEsf8xLSvhtPfQ', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post LdG79FXJPyZuhgsCR', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: SAYf6Av3PKoQxcxKo: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'SAYf6Av3PKoQxcxKo', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post PuYgAwWmoSPou46uq', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: vzLrrbEwJnB46cCu8: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'vzLrrbEwJnB46cCu8', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post eCquPuDtqfsECX7aM', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: LECz4EMGoXkNzwTZd: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'LECz4EMGoXkNzwTZd', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post 2qSJzpskQh2bFJhnh', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: ezMthoRyEkpWESnXB: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'ezMthoRyEkpWESnXB', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post cr89iEbFfbbCdcfwD', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: gbgwLHLkuP8iSzBeq: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'gbgwLHLkuP8iSzBeq', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post zvxwRGgRErBATJANf', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS: neY4aGbSKFTkPMBb2: 05-26 15:56:42.990 2146 4454 I ReactNativeJS: { _id: 'neY4aGbSKFTkPMBb2', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: title: 'Post CQyZihy3ZiyE76qSv', 05-26 15:56:42.990 2146 4454 I ReactNativeJS: _version: 1 }, 05-26 15:56:42.990 2146 4454 I ReactNativeJS:

2)

My second question is regarding to the need to install ddpClient from npm. Why did I not need to install ddpClient when dealing with login from meteor accounts, but I did when using collections?

import Meteor, { Accounts } from 'react-native-meteor';

Is this where the Accounts DDP login resides?

Thank you for any and all responses.