Closed kaisellgren closed 11 years ago
Find and findOne now alway get results from Db and never from Cache, Is problem solved?
All else seems to be ok, except that when dart2js'd, this code does not work (I'm not sure when it worked the last time):
objectory.find($TagGroup).then((tagGroups) {
print(tagGroups.first.tags.first.id);
print(tagGroups.first.tags.first.title);
});
Prints in dartium:
ObjectId(5165958455dc633b4c000005)
Biotech
and when dart2js'd in Chrome:
ObjectId(5165958455dc633b4c000005)
null
Are you able to reproduce this? Do I need to provide more code?
I believe you have to call fetchLinks() before access any property of linked object (exept for id property) Something like that shoud probably work
objectory.find($TagGroup.fetchLinks()).then((tagGroups) {
print(tagGroups.first.tags.first.id);
print(tagGroups.first.tags.first.title);
});
Even with that it doesn't print properly:
platform.objectory.find($TagGroup.fetchLinks()).then((tagGroups) {
print(tagGroups.first.tags.first.id);
print(tagGroups.first.tags.first.title);
});
Prints in dartium:
ObjectId(5165958455dc633b4c000005)
Biotech
and when dart2js'd in Chrome:
ObjectId(5165958455dc633b4c000005)
null
Remember, it works well on Dartium.
I don't think is related to Objectory.
I have client-side code that sometimes does the same database query, and now I don't see any chances because it fetches results from the
objectory.cache
.Resetting the cache to
{}
resolves my problem. I simply do the same query more than once.