These are chat archives for reactioncommerce/reaction

12th
Jul 2016
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:07 UTC
Hi
I am using
ReactionCore.Collections.Orders.find({
email: data
});
where data is the email input from user
but this query returning schema structure , it is not returning records

result of the query is like as bellow
{
"collection": {
"name": "Orders",
"_docs": {
"_map": {}
},
"_observeQueue": {
"_tasks": [],
"_running": false,
"_runTimeout": null
},
"next_qid": 1,

"queries": {},...........

any idea what is wrong?

hrath2015
@hrath2015
Jul 12 2016 07:10 UTC
have u subscribed to it
Order collection
put a fetch() and see
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:12 UTC
where to put fetch?

i m calling it like below

matchingOrders: function () {
var data = Session.get('orderEmail');

    console.log('matchingOrders called' + data);
    if (data) {
       var res =  ReactionCore.Collections.Orders.find({
           email: 'himanshu@gmail.com'
       });
        console.log('res is '+JSON.stringify(res));
        return res;
    }
}
hrath2015
@hrath2015
Jul 12 2016 07:13 UTC
ReactionCore.Collections.Orders.find({
email: 'himanshu@gmail.com'
}).fetch()
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:13 UTC
ok trying
it is returning blank array
i remved the condition as well email: 'himanshu@gmail.com' but still no result
hrath2015
@hrath2015
Jul 12 2016 07:18 UTC
u have data in DB please check first
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:19 UTC
yes i have 3 matchign records
and in db i tried following command to check the result
db.getCollection('Orders').find({})
hrath2015
@hrath2015
Jul 12 2016 07:21 UTC
please try Login as admin and see what happens.
alternatively: log in as Admin, on browser console subscribe to Orders and then run the find({}).fetch() query if data returned then review u r code please.
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:36 UTC
i tried alternate also but no data returned
in browser
hrath2015
@hrath2015
Jul 12 2016 07:38 UTC
looks like an issue with pub/sub. U are using Reaction UI to create Order?
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:38 UTC
yess
hrath2015
@hrath2015
Jul 12 2016 07:40 UTC
when u click on order icon from admin controls nothing is shown ?
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:41 UTC
if i click on orders in admin then i can see the records
hrath2015
@hrath2015
Jul 12 2016 07:46 UTC
that is good news. What are u r trying different then?
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:46 UTC
what query it is using to fetch the records? it is the same query ?
yes i m trying to impleemnt like ente rthe email and get the matching order details
new page for customer order tracking
hrath2015
@hrath2015
Jul 12 2016 07:52 UTC

this what u can mimic this.autorun(() => {
this.subscribe("Orders");
const filter = ReactionRouter.getQueryParam("filter");
const query = OrderHelper.makeQuery(filter);
const orders = ReactionCore.Collections.Orders.find(query).fetch();

this.state.set("orders", orders);

});

Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:52 UTC
when i click on order after login as Admin
hrath2015
@hrath2015
Jul 12 2016 07:52 UTC
sorry it got jumbled up
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:52 UTC
and then i run my query in console so it give result perfect
but if i go to home page as admin
hrath2015
@hrath2015
Jul 12 2016 07:53 UTC
this is the isssue with subscription
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:53 UTC
and then run again same query so blank result
how i can solve this suscription issue?
hrath2015
@hrath2015
Jul 12 2016 07:53 UTC
Meteor.subscribe("Orders") on home page and then run query
u will get result
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:54 UTC
yes right. now i m getting result on hme page as well
hrath2015
@hrath2015
Jul 12 2016 07:55 UTC
see my earlier message. Mimic the code in new template helper
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:55 UTC
i was not aware about this subscribe. let me try this with my code now
thank you for the help
hrath2015
@hrath2015
Jul 12 2016 07:55 UTC
np
this is meteor thing and RC is based on meteor
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 07:57 UTC
i m a beginner to meteor . lerning stage
:)
will it not work without sign in?
hrath2015
@hrath2015
Jul 12 2016 08:01 UTC
no it will not.
either u have to be a logged in user to your order history or admin to see all
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 08:01 UTC
any idea how to make it work without sign in ?
hrath2015
@hrath2015
Jul 12 2016 08:02 UTC
However u can enhance it based on your usecase
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 08:02 UTC
ok
Brent Hoover
@zenweasel
Jul 12 2016 09:11 UTC
@haggarwal90 DId you get it figured out?
Himanshu Aggarwal
@haggarwal90
Jul 12 2016 09:12 UTC
@zenweasel yes . as hrath advised to enhance it fr my new usecase i wrote new publisher and subscribed it
i m very close to it
will let you after success
Brent Hoover
@zenweasel
Jul 12 2016 09:13 UTC
Ok, great
Yagnatech
@Yagnatech
Jul 12 2016 09:33 UTC
@zenweasel can you tell me how can i connect my local machine mongodb instance already i have installed mongodb in my machine and its up and running but reaction database i want to store into local machine mongodb instance
{
"ROOT_URL": "",
"MONGO_URL": "mongodb://localhost:27017/reaction",
"reaction": {
"REACTION_USER": "",
"REACTION_AUTH": "",
"REACTION_EMAIL": ""
},
"isDebug": "info",
"public": {}
}
Brent Hoover
@zenweasel
Jul 12 2016 09:34 UTC
Yeah, that should do it
Yagnatech
@Yagnatech
Jul 12 2016 09:34 UTC
i did changes in settings/setting.json file
running this command meteor --raw-logs --settings settings/settings.json but its not connecting it to local machine mongodb instance
Brent Hoover
@zenweasel
Jul 12 2016 09:36 UTC
Try setting it in an environment variable
I think somebody else was saying that setting the URL in settings was not working for them
Yagnatech
@Yagnatech
Jul 12 2016 09:39 UTC
@zenweasel ok i will try it
Yagnatech
@Yagnatech
Jul 12 2016 10:13 UTC
@zenweasel after setting environment variable its worked fine.
Brent Hoover
@zenweasel
Jul 12 2016 10:27 UTC
Great. :+1:
Eric Jonas
@ericmachine88
Jul 12 2016 14:51 UTC
is there any updated reaction commerce? or still the same version? Thanks.
Jeremy Shimko
@jshimko
Jul 12 2016 15:02 UTC
Same version as what?
Aaron Judd
@aaronjudd
Jul 12 2016 15:16 UTC
@ericmachine88 the most recent version is the development branch. We’re getting close to merging this to the master branch, probably late wednesday/thursday (a 0.14 release)
Spencer Norman
@spencern
Jul 12 2016 20:44 UTC
In 0.14, how do we link to images that are included in a package/plugin (former Meteor package)