kuzzleio / kuzzle-admin-console

A SPA to administrate your Kuzzle: index and collection management, document creation, realtime subscription and permissions management
http://console.kuzzle.io
Apache License 2.0
61 stars 25 forks source link

ID displayed isn't good when document include a field "id" #838

Closed neolas closed 3 years ago

neolas commented 3 years ago

Context

Hi, I don't know if it's a feature or a bug but I spent a lot of time to understand what happens.

It's simple, when documents include a field "id", the console use this field as identifier in view line and not real document id. In my usage I generate a specific ID for documents to get them quickly and "id" field in my document store other information.

So, as I said, I don't know if it's a bug or a feature, but I lost time to find solution and it's when I used directly API that I saw that ID was ok after my imports.

Expected Behavior

See view line of documents with good document _id

Current Behavior

We saw field "id" in document and not reald document _id

Possible Solution

To "fix" this I rename field id and reimport documents

Steps to Reproduce

  1. Import document this a field "id"
  2. Show them in Console next generation

Context (Environment)

Kuzzle version: 2.6.0 Node.js version: v12.13.1 Admin Console Version: 4-dev (http://next-console.kuzzle.io/)

xbill82 commented 3 years ago

When we did it we thought "It's OK, noone will ever add an id field within the body of the document, there's already the _id provided by Elasticsearch." Lesson learned.