Skip to content

When i want to update some stuff but got error #4342

Closed
@IOsonoTAN

Description

Issue Description

I have a client they're using a Parse@1.9.2 in frontend and connect with ParseServer@2.2.14 so i have to fix some problem for them, i tried to create a new object, get detail or delete some object that all works fine but i can't update any object, it always return error code 101 and message is "Object not found."

Steps to reproduce

  1. I've mongoDB collection named "Article" and this is a schema of this collection.
{
  "_id": "OjsasOSExy",
  "name": "article one",
  "detail": "article one detail",
  "rank": 0,
  "_created_at": "2017-11-13T16:45:00.000+0700",
  "_updated_at": "2017-11-13T16:45:00.000+0700"
},
{
  "_id": "ikDqSQ0pVp",
  "name": "article two",
  "detail": "article two detail",
  "rank": 1,
  "_created_at": "2017-11-13T16:45:00.000+0700",
  "_updated_at": "2017-11-13T16:45:00.000+0700"
}
  1. I want to re-order of rank field.
const Article = Parse.Object.extend('Article')

new Promise((resolve, reject) => {
  const articles = articles.map((article, index) => {
    return new Article({
      objectId: article.objectId,
      rank: index
    })
  })

  Parse.Object.saveAll(articles, {
    success: (articles) => {
      resolve(articles)
    },
    error: (e) => {
      reject(e)
    }
  })
})

Expected Results

The data update success with new rank.

Actual Outcome

I got error from ParseServer.

verbose: {
  "response": [
    {
      "error": {
        "code": 101,
        "error": "Object not found."
      }
    },
    {
      "error": {
        "code": 101,
        "error": "Object not found."
      }
    }
  ]
}

Environment Setup

  • Server

    • parse-server version: 2.2.14
    • Operating System: MacOS (10.12.5)
    • Hardware: Macbook Pro 2017
    • Localhost or remote server: Localhost
  • Database

    • MongoDB version: v3.4.6
    • Storage engine: -
    • Hardware: -
    • Localhost or remote server: Localhost

Thank you

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions