hello
I have a website developed in nodejs and use as jade template engine. I
found a small bug and should be around me.
I have a dynamic URL parameter capturing a final and mongo used to search ,
always use the same scheme, same template but different data depending on
the parameter.
In my application shows me all data from all parameters, as if the data
were mixed, at first I thought it was my fault, that would be mixed in an
intermediate variable and the application was debugger hours and did not
find anything, the code was correct. I happened to restart the application
and mysteriously works again (until new data is entered into the database),
it's like will cache data and mingle among them. Does anyone know what can
be and how can I fix it? Reset nodejs does not seem very professional and
can not find how to fix it. Thank you.
#Source
- Nodejs
app.get('/brand/:identifier', function(req, res){
brands.find({ active: true, 'brandName' : { $regex : new
RegExp(identifier, "i")} }).populate({
path: 'shop'
,select: 'name shop description'
}).sort({dateAdded: 'desc'}).exec(function(err, doc) {
if(doc && doc.length) {
return res.render('brand_list', {
shop: doc[0].shop.shop
,name: doc[0].shop.name
,description:
doc[0].shop.description
,pageTitle: doc[0].shop.shop
,products: doc
});
}
});
});
- Jade (resumed)
each product in products
li.product(id=product.identifier, name=product.identifier)
a(href='/show/' + product.identifier, target='_blank')
Regards
Anto
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.