How to include key(s) to the response of save(…)

Is there a way to include keys to the response of save (on a Parse.Object) so the response includes the specified keys?

Do you wanna add some keys to response but you dont want these keys to be saved in database? Right? Which sdk are you using? What environment? Cloud Code or mobile app maybe?

I am using the JS SDK in my back-end.

By “include keys” I am referring to this feature : ParseQuery - Documentation

Let’s take this exemple:


class Post extends Parse.Object<{
  title: string;
  author: Author;
}> {
  constructor(options?: any) {
    super("Post", options);
  }
}

class Author extends Parse.Object<{
  firstName: string;
  lastName: string;
}> {
  constructor(options?: any) {
    super("Author", options);
  }
}

export async function updatePostTitle(postId, title) {
  const post = new Post()
  post.id = postId
  return await post.save(
    { title: "This is a demo" },
    { include: "author" } // <- I would like to do this so `updatePostTitle` return the post object including author
  );
}

Ah. I believe thats only available for Parse.Query. So you need to re-fetch your include key with query.