Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

increment('test.name',1) with Parse.Cloud.beforeSave is not work #6358

Closed
lybaiyy123 opened this issue Jan 22, 2020 · 3 comments · Fixed by #7003
Closed

increment('test.name',1) with Parse.Cloud.beforeSave is not work #6358

lybaiyy123 opened this issue Jan 22, 2020 · 3 comments · Fixed by #7003
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@lybaiyy123
Copy link

Issue Description

var t=new Parse.Object('test')
t.set('test',{name:1,age:2})
t.save()

t.increment('test.name',1)
t.save()

when i creat a cloudFunction liks this,
Parse.Cloud.beforeSave('test',function(req){
// console.log(req.triggerName)
// console.log(req.object.toJSON())

})

t.increment('test.name',1) is not work,

Steps to reproduce

Expected Results

Actual Outcome

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : [FILL THIS OUT] 3.10
    • Operating System: [FILL THIS OUT] windows
    • Hardware: [FILL THIS OUT]
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): [FILL THIS OUT] Localhost
  • Database

    • MongoDB version: [FILL THIS OUT] 3.4?
    • Storage engine: [FILL THIS OUT]
    • Hardware: [FILL THIS OUT] 4C8G
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): [FILL THIS OUT] remote server

Logs/Trace

QQ截图20200122174829

@lybaiyy123 lybaiyy123 changed the title increment increment('test.name',1) with Parse.Cloud.beforeSave is not work Jan 22, 2020
@davimacedo
Copy link
Member

Thanks for reporting. Could you please write a test case?

@lybaiyy123
Copy link
Author

Thanks for reporting. Could you please write a test case?

step 1:
var t=new Parse.Object('testobject')
t.set('testFiled',{'name:1','age:2'})
t.save()

step 2:
creat a cloudFunction liks this,
Parse.Cloud.beforeSave('test',function(req){
// console.log(req.triggerName)
// console.log(req.object.toJSON())
})

step3:
t.increment('testFiled.name',1)
t.save()

expected result:
after t.save() , the testFiled={'name:2','age:2'}

@davimacedo davimacedo added type:bug Impaired feature or lacking behavior that is likely assumed needs investigation labels Jan 28, 2020
@dplewis dplewis linked a pull request Nov 12, 2020 that will close this issue
@dplewis
Copy link
Member

dplewis commented Nov 12, 2020

Closing via #7003

@dplewis dplewis closed this as completed Nov 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants