Code Monkey home page Code Monkey logo

acronym-web-app's People

Contributors

erob123 avatar haithamshahin333 avatar snekcode avatar

acronym-web-app's Issues

Error: Non Unique Record in Database

Steps to recreate:

This query:
acronyms?bullets=SS

Expected:

Normal API response

Actual:

Results in the following response:

{
   "timestamp":"2019-04-28T06:24:43.373+0000",
   "status":500,
   "error":"Internal Server Error",
   "message":"Query { 
      \"$java\" : Query: { \"name\" : \"SS\" }, 
      Fields: { }, 
      Sort: { } 
   } returned non unique result.","path":"/acronyms"
}

The Issue:

Looking at the mongo inject script, these two records exist on separate lines:

{"name": "SS","definition": ["Submarine"]},
{"name": "SS","definition": ["Sea State (Number)"]},

The Fix:

I would assume these should be combined:

{"name": "SS","definition": ["Sea State (Number)", "Submarine"]},

I didn't look to see if any of the other records were repeated.

API Response Format Request

Description:

In the DB, the description field is an array of descriptions. It would make that field slightly easier to consume on the front end if it could be sent as an array, instead of as a single string, as it is currently sent.

Current Response Format:

{"acronyms": [
   {
      "name":"AA",
      "definition":"Assessment Agent,Avenue Of Approach"
   },
   {
      // more acronyms
   }
]}

Requested Response Format:

{"acronyms": [
   {
      "name":"AA",
      "definition": [ "Assessment Agent", "Avenue Of Approach"]
   },
   {
      // more acronyms
   }
]}

Example

{
   name: "GB",
   description: "Group Buffer,Sarin, A Nerve Agent"
}

Commas are not used in exactly the same way for every record.

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.