Open chiffa opened 10 years ago
Some DBs such as Neo4j don't allow properties to be dictionaries (only primitive arrays). In this case you can use the Bulbs Document type instead of Dictionary -- the Document type converts Python dicts to JSON string before writing to the DB, and it converts JSON strings back to Python dicts when read from the DB.
Great, would you mind providing more info about the Document type? I couldn't find it in the usual property documentation location: http://bulbflow.com/docs/api/bulbs/property/#property
The online docs need to be updated. The Document Property
is defined here:
And here's how it gets called when using the default JSON type system:
NOTE: The Document Property
definition uses the JSON type system's to_document()
method to convert a Python dict
to a JSON string when saving to the database, but it uses the to_dictionary()
method to convert the JSON string to a Python dict
when reading from the database.
Great, thanks. Would you mind adding it to doc in a future release?
When the Dictionary property is attached and used the following error arises:
SystemError: ({'status': '200', 'content-length': '110', 'content-type': 'application/json; charset=UTF-8', 'access-control-allow-origin': '*', 'server': 'Jetty(6.1.25)'}, '"java.lang.IllegalArgumentException: Unknown property type on: {nom=1, mnom=1}, class java.util.LinkedHashMap"')