◢███◤      ◢██◤                            ◢██◤                            
     ◢██◤       ◢██◤                            ◢██◤                             
    ◢██◤       ◢██◤                            ◢██◤                              
   ◢██◤       ◢██◤                            ◢██◤                               
  ◢██◤       ◢██◤                            ◢██◤                                
◢███◤       ◢██◤                            ◢██◤                          ◥██◣   
◥███       ◢█████◣    ◢████████◤ ◢███████◤ ◢██◤ ◢██◤                 ◢██◤   ██◣  
 ███      ◢███████◣        ◢██◤ ◢██◤ ◢██◤ ◢███████◤                 ◢██◤    ███  
 ███     ◢██◤  ◢██◤ ◢████████◤ ◢██◤      ◢█████◣                   ◢██◤     ███  
 ███    ◢██◤  ◢██◤ ◢██◤  ███◤ ◢██◤ ◢██◤ ◢██◤◥███◣                 ◢██◤      ███  
 ◥██   ◢██◤  ◢██◤ ◢████████◤ ◢███████◤ ◢██◤  ◥███◣               ◢██◤       ███◣ 
  ◥██◣                                                          ◢██◤       ◢███◤ 
                                 ◢███◤ ◢███◤ ◢██◤  ◢██◤ ◢█████████◤       ◢██◤   
                                ◢█████████◤ ◢██◤  ◢██◤ ◢██◤  ████◤       ◢██◤    
                               ◢██◤◢█◤◢██◤ ◢██◤  ◢██◤ ◢██◤   ███◤       ◢██◤     
                              ◢██◤   ◢██◤ ◢████████◤ ◢█████████◤       ◢██◤      
                             ◢██◤   ◢██◤ ◢████████◤ ◢█████████◤      ◢███◤       

0002
[Convenience] sys.upgrades{filter:} multiple searches
Being able to search for multiple upgrade names/types/etc. {`Nfilter`:{`Nname`:`V"k3y_v1"`,`Ntype`:`V"lock"`}} Would be a plus to have the option to pass arrays of keys. `Nname`:[`V"k3y_v1"`,`V"k3y_v2"`,`V"k3y_v3"`] The current easiest way to achieve this is to sort {`Nfull`:`Vtrue`} through a script
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
For your second exampke: `Fsys`.`Lupgrades`{`Nfilter`:`V{``Nname`:`V{``N"$in"`:`V[``A"sn_w_glock","sn_w_usac"]}}}` For your first, that is... a filter looking for something named k3y_v1 and type lock (remember, mongo implicitly does and). That.... doesn't work? And it couldn't be made to work because what if I did `Nname`:`V"script_slot_v2"`,`Nslots`:`V2`. I wouldn't want it to do `Nname`:`V"script_slot_v2"` OR `Nslots`:`V2` (which would include, for example, 2-slot public scripts despite me asking for script_slot only). It's explicitly an and. Sean could support the mongo `C$or`, I suppose. That'd look like {`Nfilter`:{`N"$or"`:[{`Nname`:`V"k3y_v1"`},{`Ntype`:`V"lock"`}]}}, but it gets awkward fast. Also, generally speaking, you save no time by using these filters which are an incomplete reimplementation of mongo, versus just doing your own filtering in JS. I don't think I've ever once used the filter arg, i just run through Array.prototype.filter, which is significantly more flexible (and almost certainly faster than the fake mongo queries in JS) For example, your first thing would just be: #hs.`Fsys`.`Lupgrades`({`Nfull`:`Vtrue`}).filter(u=>u.name=="k3y_v1"||u.type=="lock") Probably shorter than using $or, almost definitely faster, and way more flexible.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I was unaware of $in. Thank you for reminding me, ill be sure to check mongo documentation
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -