@pitaj
-- benchpressjs@2.3.0

Latest posts made by shayan
-
RE: reference to objects in benchpress
@pitaj I copied exactly my
data
(after fixing the syntax error before"b"
) that I wrote here and your code. it did not work.
-
RE: reference to objects in benchpress
@pitaj
I want to have a list for every key inpeople
object and populate that list with the names of people I have in array of every key, something like this:
fora
:- john
- dave
for
b
:- sam
- eli
- nicole
I did not mention that but I also tried using
./name
. it also didn't show any names, just an empty bullet.
the only way I could reference the object was with@value
but when I tried to access a value of a specific key (like{@value.name}
) it just wrote{[object Object].name}
instead of actual value -
RE: reference to objects in benchpress
(Unless there's some crazy behaviour in benchpress that allows for iterating through objects...)
there is an example in the documentation (https://github.com/benchpressjs/benchpressjs/blob/master/docs/iteration.md#example-2-1) which has a similar structure to my data but it is kind of vague on how should I Iterate and reference the values if every value of a key like
jumpbugger
is an array of objects.However I would really not recommend naming both nested objects
people
. That is confusingmaybe how I structured the data is not standard but my problem was that the nested objects (like the second and third
people
key in your structure) has a dynamic key (likea
andb
) and not a static one (likepeople
which you said) , so I couldn't iterate over it no matter what I did.
fortunately I can change the structure so tnx.
-
reference to objects in benchpress
hi
I'm trying to write a template for a plugin with some data that looks like this:const data = { people:{ "a": [ {name:'john',id:1}, {name:'dave',id:2} ] "b": [ {name:'sam',id:1}, {name:'eli',id:2}, {name:'nicole',id:3} ] } } res.render('path/template-name', data)
my code in template is something like this:
{{{ each people}}} <div> <ul> {{{each people}}} <li> {people.name} </li> {{{end}}} </ul> </div> {{{ end }}}
when I render the template it does create two lists with 2 and 3 items but it doesn't show the names. I tried doing it with @value.name instead of people.name too but it just writes {[object Object].name}.
can anyone show me what I'm doing wrong?
@3rd-Party-Developers -
RE: New in 1.2.0?
@julian I know this is an old thread but did this feature ever moved to a plugin?
there seems to be some harmful behavior in chats of some of my forum's users, so I need to give admins, means to monitor the chats if someone is suspicious of doing that. -
RE: mongodb database structure and Queries document
tnx, quess you are right. now I have to scan the whole source code for any use of database
-
mongodb database structure and Queries document
Hi,
I'm trying to redesign mongodb database for better performance.
I didn't see a complete document at https://docs.nodebb.org/development/database-structure/ (for example there was no mention of documents for analytics).
if there is any document or guideline for mongodb queries and/or database design currently used in nodeBB it would speed up the process tremendously, if someone could share it.
@Community-Representatives
@administrators