GithubHelp home page GithubHelp logo

Comments (26)

adefokun avatar adefokun commented on July 20, 2024 2

But m having the same issue with 1.9.2 included key shows fully in network response but
get('includedKey').get('property') fails.

from parse-sdk-js.

mbruschi avatar mbruschi commented on July 20, 2024 1

Hey, I'm experiencing the same issue in 1.9.

  var query = new Parse.Query('TimeEntry');
  var date = request.param.date;

  date.setHours(0, 0, 0, 0);
  query.greaterThanOrEqualTo('endDate', date);

  date.setHours(23, 59, 59, 999);
  query.lessThanOrEqualTo('startDate', date);

  query.ascending('startDate');

  query.include('project');

However the result does not include e.g. the project title or the color (both String).

[Object]
0:Object
  endDate: Fri Jul 08 2016 10:48:53 GMT+0200 (CEST)
  project: ParseObject
    _objCount: 4
    attributes: (...)
    className: "Project"
    createdAt: (...)
    id: "Si2r48jM1O"
    updatedAt: (...)
    __proto__: Object
  startDate: Fri Jul 08 2016 10:42:04 GMT+0200 (CEST)
...

I even tried to extend the Parse.Object like this and call the query correspondingly but with no result, except that the 'project' becomes a ParseSubclassObject.

var TimeEntry = Parse.Object.extend('TimeEntry');
var Project = Parse.Object.extend('Project');
var query = Parse.Query(TimeEntry);

What else can I do?

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024 1

@mbruschi the attributes object there contains your properties. Printing an object with console.log does not show attributes, since they are a) noisy and b) generated on demand from any local unsaved changes.

The fact that project is not a pointer, but a full-blown object with createdAt and updatedAt fields suggests that the include worked exactly as intended.

from parse-sdk-js.

marlonguerios avatar marlonguerios commented on July 20, 2024

just tried changing Parse version to latest instead of 1.6.4 and query.include is working. I wonder what is the problem with setting the Parse version to 1.6.4 through parse jssdk 1.6.4?

from parse-sdk-js.

parse-github-bot avatar parse-github-bot commented on July 20, 2024

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

from parse-sdk-js.

marlonguerios avatar marlonguerios commented on July 20, 2024

Here is the code:

var query = new Parse.Query("Menu");
        query.equalTo("objectId", req.params.menuId);
        query.find().then(function (menu) {
            var relation = menu[0].relation("sections");
            var relQuery = relation.query();
            relQuery.include("pdName");
            return relQuery.find();
        }).then(function (sections) {
            var json = {
                draw: draw,
                data: sections,
                recordsFiltered: sections.length,
                recordsTotal: sections.length
            };
            res.json(json);
        }, function (error) {
            res.json(error);
        });

Here is what I get for the field pdName for version 1.6.4:

      "pdName": {
        "__type": "Pointer",
        "className": "PhraseDictionary",
        "objectId": "8N1TwAQvR7"
      },

Here is what I get for the field pdName with either version: latest or 1.6.2

"pdName": {
        "createdAt": {
          "__type": "Date",
          "iso": "2015-10-01T01:54:43.289Z"
        },
        "de": "",
        "en": "Test name",
        "es": "",
        "fr": "",
        "it": "",
        "place": {
          "__type": "Pointer",
          "className": "Place",
          "objectId": "GrQzLeDfjh"
        }

It seems that latest is not pointing to 1.6.4 because I still have the same parent not defined error when using it, but when I change to 1.6.4 the relation error is not happening, but the query.include one yes.

I hope I made myself clear.
Thanks

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

This might be an issue with caching on our cloud code servers. I'll kick off a cache flush and see if latest then points to 1.6.4 as it should.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

"latest" now appears as 1.6.4 for me. Check if you're still having issues, @marlonguerios

from parse-sdk-js.

a2 avatar a2 commented on July 20, 2024

I can confirm that 1.6.2 works and 1.6.4 does not.

from parse-sdk-js.

marlonguerios avatar marlonguerios commented on July 20, 2024

Same here. Now latest is pointing to 1.6.4, but I still have the problem with query.include not returning the included object.

from parse-sdk-js.

desamtralized avatar desamtralized commented on July 20, 2024

Same issue here, my cloud code just stopped working, not included objects anymore :(
Changed to 1.6.2 and fixed.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

From my investigation, it seem that this only affects the results of queries made in cloud code (the query fetches the nested objects, they are available in cloud code, but when they return to the client they are pointers). Is that in line with what everyone here is experiencing?

from parse-sdk-js.

desamtralized avatar desamtralized commented on July 20, 2024

@andrewimm same behavior here.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

Sorry all, I believe this was an oversight introduced in f2d35f2. We didn't realize this would affect nested queries coming back from cloud code, but we should have a fix in later today.

In the meantime, we've added tests for returning nested query results to our Cloud Code suite, so that we'll notice beforehand if something here breaks again.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

1.6.6 fixes this. It's out on npm now, and is currently being deployed to cloud code. I'll follow up when that process has completed.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

This happened last night. 1.6.6 is available everywhere, and should fix this issue. "latest" on cloud code should also point to 1.6.6

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

can you check this works with dotted dotted includes? e.g. x.y , myObject.createdUserRef

I am trying to get this to work and it works at the first level now, but doesn't seem to traverse

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

is 'seen' in toJSON too simple? what about scenario where there are 2 pointers to the same object, but for different reasons and you want to expand 1. e,g,

"createdUserRef": {
"__type": "Pointer",
"className": "_User",
"objectId": "tUFQNVcQSD"
},
"userRef": {
"__type": "Pointer",
"className": "_User",
"objectId": "tUFQNVcQSD"
},

here the createdBy user and the user are different things that happen to point to the same _User

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

@swilli40, we tried passing seen to toJSON, but the two paths were decoupled just enough that it made the process difficult to do cleanly. I would like to generalize the idea that all special types know how to encode themselves, and that encode simply does the tree-crawling, but it's going to take a little more time to clean up. You can consider 1.6.6/.7 as immediate responses to most people encountering this problem, while we buy ourselves a few more days to get a cleaner solution under the hood. I'm actively working on this.

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

@swilli40 actually, I take that back. It looks like the original attempts were complicated by the same issue I hit with the eventually-merged solution: the exported version of encode did not take a seen-array as an argument. I've rewritten the solution, and once I've verified it works with multiple nested includes, I'll get it out to cloud code.

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

It might need a leaf first crawler as converting a parse object to object means lower objects with attributes won't be expanded. Bottom up would prevent this issue.

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

any news on this one?

from parse-sdk-js.

andrewimm avatar andrewimm commented on July 20, 2024

This should have been fixed in 1.6.8, which is currently on npm and will go out to cloud code later today

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

great. thanks

from parse-sdk-js.

swilli40 avatar swilli40 commented on July 20, 2024

Andrew, not fixed, built the 1.6.8 and debugged locally. Same issue with dotted includes. x.y
Parse REST interface expands, but _toFullJSON(), toJSON() converts to Pointer objects, even if include is specified and the returned JSON is expanded from Parse

from parse-sdk-js.

aacassandra avatar aacassandra commented on July 20, 2024

the same issue in 2.4.0
this is my code

  return new Promise((resolve, reject) => {
    // const Class = Parse.Object.extend(CLASS);
    const query = new Parse.Query(CLASS);
    query.include([
      "billboard",
      "billboard.complaintStatus",
      "billboard.taxStatus"
    ]);
    query.equalTo(OBJECT, KEY);
    query.find().then(
      res => {
        resolve(res);
      },
      err => {
        reject(err);
      }
    );
  });

billboard is a column name (pointer)
somebody help me? thanks

from parse-sdk-js.

Related Issues (20)

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.