NexusHub icon indicating copy to clipboard operation
NexusHub copied to clipboard

Filter items by drop location

Open Kaptard opened this issue 6 years ago • 1 comments

I'm submitting a...

  • [ ] Bug report
  • [x] Feature request
  • [ ] Documentation issue or request

Current behavior

Would have to go through every single relic and their drops to see what's worth the most.


Expected behavior

Should be able to sort by highest price + limit results to drops from a relic. In other words, this would be an extension of the search/item page which allows limiting results to certain drop locations.


Minimal reproduction of the problem

See current behavior. Lots of tedious work.


Environment

Browser:

  • [ ] Chrome (desktop) version:
  • [ ] Chrome (Android) version:
  • [ ] Chrome (iOS) version:
  • [ ] Firefox version:
  • [ ] Safari (desktop) version:
  • [ ] Safari (iOS) version:
  • [ ] IE version:
  • [ ] Edge version:

For development issues:

  • Node version:
  • Operating System:

Additional Description

Kaptard avatar Apr 09 '19 14:04 Kaptard

Not sure if this issue is still of interest but if so, we can find items by drop locations using a MongoDB Aggregation.

In this example below I use "Lith S3 Intact" for the drop location.

[{$match: {
  'components.drops.location': 'Lith S3 Intact'
}}, {$unwind: {
  path: '$components',
  preserveNullAndEmptyArrays: false
}
}, {$unwind: {
  path: '$components.drops',
  preserveNullAndEmptyArrays: false
}}, {$match: {
  'components.drops.location': 'Lith S3 Intact'
}}, {$project: {
  "_id": 0,
  "name": 1,
  "components.name": 1,
  "components.drops.chance": 1,
  "components.ducats": 1,
  "components.prices": 1
}}]

The above aggregation produces these results. Note: I omitted the price property and all but one returned document for the sake of brevity.

{
        "components" : {
                "name" : "Blueprint",
                "ducats" : 15,
                "drops" : {
                        "chance" : 0.25329999999999997
                }
        },
        "name" : "Akbronco Prime"
}

So as long as we know what drop location we want to get items from, we can use this aggregation to get all the items from said drop location. This should be fairly easy to work into existing systems. Also gives the potential to display what is dropped from what relics on those relic's pages.

jtbry avatar Nov 08 '20 03:11 jtbry