Giter Club home page Giter Club logo

Comments (9)

LartTyler avatar LartTyler commented on August 17, 2024 3

@cheng1994 Sorry, reading over that again I'm realizing that my plan wasn't very clear.

In most cases, any change I make to an existing endpoint will be backwards compatible, with a deprecation notice in the changelog of the release detailing which future release or on what date the old information will be removed.

As far as this change goes, I'm going to leave the slotsRank# fields as they are in the attributes field. I'll be adding a slots field to the object itself that'll include the slot rank information, which should make (for example) armor objects look something like this (some fields are removed from the example below for brevity).

{
  "id": 505,
  "name": "Diablos Nero Coil Beta",
  "attributes": {
    "slotsRank2": 1
  },
  "slots": [
    {
      "rank": 2
    }
  ]
}

So in your case, your application can continue to function as is, giving you time to make the change over to the new format.

from mhwdb-docs.

kclay avatar kclay commented on August 17, 2024

Agree this would be a good change, I actually have something like this for my needs.

from mhwdb-docs.

RayLuxembourg avatar RayLuxembourg commented on August 17, 2024

@kclay what are you developing :O?

from mhwdb-docs.

LartTyler avatar LartTyler commented on August 17, 2024

I need to pick a format that works best with how the API is set up, but I'm thinking of changing slots to something like this:

{
    "slots": [
        1,
        1
    ]
}
{
    "slots": [
        2,
    ]
}

Basically, just an array with 0 to 3 elements, each one an integer representing the rank of the slot.

from mhwdb-docs.

kclay avatar kclay commented on August 17, 2024

@LartTyler I sorta like what @RayLuxembourg proposed. It allows easy attaching on other properties without any data remodeling. For instance, if I'm making a build simulator I would want my builder to show what slots I have and what deco is set on that slot. This can be achieved by simply doing

{
"slots":[
   {rank:1,deco:<decoId>}
   ]
}

Not really a big deal as we can always remodel the data client side, but it seems this would solve two use cases (mines and OP). Now as for the querying of this data. It looks like you are using mongodb Or does Mysql now allow json query been a while since I've used MySQL, saw you stated it on reddit. But with mongo I think you could do slots:{$in:{rank:1}}? Not sure if this is a valid query or what performance cost it may have.

from mhwdb-docs.

LartTyler avatar LartTyler commented on August 17, 2024

@kclay The backend is MySQL, not Mongo, but I built this library to translate Mongo-style queries to MySQL statements because I thought it was a decent way to handle searching endpoints. At the moment, I'm having issues working with MySQL's limited JSON functions in order to make something like {"slots":{"$in":{"rank":1}}} work.

The solution would be the move the slot data to it's own table, which would allow something like {"slots.rank":1} to work like you'd expect, returning any armor or weapon that has a rank 1 slot. Since you all seem to agree that the current format doesn't work, I'll get this added to the backlog. It's a simple enough change, so I'll plan on doing it next, after I finish up with #15.

from mhwdb-docs.

kclay avatar kclay commented on August 17, 2024

Nice library fooled me. Can't wait for #15 its really the only piece I'm missing right now for this builder. So for now I'm going to work on the searching and computing all the stats values.

from mhwdb-docs.

cheng1994 avatar cheng1994 commented on August 17, 2024

@LartTyler So to clarify you plan on moving slots to a separate key in each armor and weapon piece and then follow it with children with key rank? I'd like to prep my application for the change since I've already made slotsRank1 work in my case. But I'm more than open for improvements.

Also if anyone wants to take a look my application is at The Research Commision its still a work in progress

from mhwdb-docs.

LartTyler avatar LartTyler commented on August 17, 2024

Slot information has been migrated to the new format in v1.8.0.

from mhwdb-docs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.