-
Notifications
You must be signed in to change notification settings - Fork 55
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
500 when using array type #55
Comments
I'm not sure why the Array type was removed, but I believe it will work if you change |
Array datatype was kind of superfluous -- and it made the round-trip serialization story simpler just to say "we have all these specific scalar datatypes, and 'object' for anything else." This was noted in the changelog -- sorry we missed removing it from the list of documented datatypes. I just removed it, and the site should pick up the changes sometime today. Let me know if you see any other references to it floating around. :) |
Hmm, yeah I guess I could do
Now, whats the easiest way to query "all users part of |
No, you can save any JSONizable object in that datatype. Just declare it as datatype 'object', and save the array like normal. Any reason not to use the Postgres adapter with eager-fetched associations and do an actual join? :) That's what that's for. |
Do this:
Just call it an object (everything in JS is technically an object), but keep the value as an array. |
@mde Probably because SQL sucks. |
Ah, I see, yeah I thought @mde I probably will later, but thats why I'm using Geddy. I can build this out as a prototype and then swap out the DB without too much fuss! (well, I hope haha) |
@techwraith You don't have to write any SQL, that's the whole point. :) |
@mde Well, if you only use Geddy to access the data, that's true, but if you ever have to edit data directly in the DB, that's not true. Though I suppose that's what |
NOSQL is great for things where you don't want any relationship between pieces of data. @OscarGodson is jumping through extra hoops to make non-relational data relational. If you actually want relationships between things, use a relational database. Then you can get the list of Users, the list of Groups, the list of Users per Group, and the list of Groups per Users. I keep thinking it's weird to see people a non-relational store, and then doing all these weird, hacky things to get relational behavior. |
@mde For this it's just because I'm trying to get a prototype. I'm a noob at SQL and I've never interacted with Postgres directly. I will switch it for sure if it makes it past the prototype stage, but this is basically the only join I need to make for this stage. Geddy just allows me to plug-n-play™ DBs so I can put off the SQL learning curve for a bit ;) |
Hello. |
@raphaeltm Maybe we could start with a Gist of some of the problem code? Where are you setting the value for the tags prop? |
So, I'm new to Node and Geddy and I think I figured it out. I have a Project model with a property In the "Create" action, after
(a method I added to the model for this purpose. it returns the array of tags.) The PHP frameworks I've used in the past allow this sort of assignment before validation. With Geddy, it seems that if I use Sorry if this was a bit silly. I guess it will take me a little while to figure this all out. Thanks for the prompt response, though. |
No worries, glad you got it figured out. :) |
In the model docs it says I can do:
In my controller (
create()
) I have:But it throws a 500
Simply changing it to a "string" type and changing
bar.foos = [fooId];
tobar.foos = fooId;
makes it work.cc: @dadambickford
The text was updated successfully, but these errors were encountered: