Any info on the new object and array field types located in the Corvid database? I haven't been able to find any documentation on them.
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
![feature fixed.png](https://static.wixstatic.com/media/3bfa8a_f845e1016b8a49758acdd6edd6610c3b~mv2.png/v1/crop/x_0,y_2,w_852,h_508/fill/w_104,h_62,al_c,q_85,usm_0.66_1.00_0.01,enc_auto/feature%20fixed.png)
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page
Can anyone provide a solid use case with code for a collection object? Even just the use case would be great. Just keep it simple for code noobs like me. I've done some good work with arrays in collections and love them. Getting data in and out of a collection array is a bit of a trick, but it works; it's incredibly flexible; it's fast, and arrays leverage the power of collections, IMO. Just watch your use of null. To pass or compare null, you need (null) with parentheses. Used without the parentheses gives quirky, unreliable results. But objects sound very interesting. Anyone got anything good?
I would like to be able to place some html in the object field. I would like to be able to add latex code, rendered via mathjax. If I select the text as the field type, the latex doesn’t work. Is using “object” the correct way to do this? So can the object be html code?
Did anyone find any documentation? What's the correct format for storing an array in the collection?
@Dave now that you can store your arrays directly in collection I don't see any reason not to use the feature. There isn't much documentation because none is really necessary. There are much more complexes types such as Media gallery and address that do need a bit of documentation in order to be used properly but Arrays and Object are standard feature of javascript :)
Um... releasing a feature without documentation, regardless of whether it is for advanced coders or not is a really bad idea. I just started to see errors in the Content Manager out of the blue about values not matching the field type for a database where I am storing arrays as strings. It begs the question: if I don't change the field type from text to array or object, will code start to break?
@Eric. I use it to store $w-element properties (Required, MaxLen, etc) as key-value pairs. I will also use it in a former project where I stored query-results in a string , so stringified. It´s better to keep it as an object, so Date data types can stay dates instead of strings.
@Eric Those new types have been added at the request of the Corvid Masters. The documentation will come later. Those fields are for advanced coders. They are used to store javascript object in the DB without transformation into a string. This means you can use object type to store javascript variable directly in your DB. Objects are extremely useful when dealing with complex data structures (like geo data) or with non-uniform data. Arrays are just a table of Value. You used them to store a list of string(like tag field) number, or even object. Does that answer your question?
Good question. This is a really advanced feature - and I believe one of the Corvid masters is planning on writing something about it.
@Brett Haralson (Wix) Any insight?