Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups
    1. Home
    2. shayan
    • Profile
    • Following 0
    • Followers 1
    • Topics 2
    • Posts 8
    • Best 0
    • Groups 0

    shayan

    @shayan

    0
    Reputation
    3
    Profile views
    8
    Posts
    1
    Followers
    0
    Following
    Joined Last Online

    shayan Unfollow Follow

    Latest posts made by shayan

    • RE: reference to objects in benchpress

      @pitaj
      -- benchpressjs@2.3.0

      posted in Plugin Development
      shayan
      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.

      posted in Plugin Development
      shayan
      shayan
    • RE: reference to objects in benchpress

      @pitaj
      I want to have a list for every key in people object and populate that list with the names of people I have in array of every key, something like this:
      for a:

      • 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

      posted in Plugin Development
      shayan
      shayan
    • RE: reference to objects in benchpress

      @julian

      (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 confusing 🙂

      maybe 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 (like a and b) and not a static one (like people which you said) , so I couldn't iterate over it no matter what I did.
      fortunately I can change the structure so tnx😃 .

      posted in Plugin Development
      shayan
      shayan
    • 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

      posted in Plugin Development
      shayan
      shayan
    • 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.

      posted in General Discussion
      shayan
      shayan
    • 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 😢

      posted in NodeBB Development
      shayan
      shayan
    • 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

      posted in NodeBB Development
      shayan
      shayan