-
Type: Task
-
Resolution: Done
-
Affects Version/s: None
-
Component/s: None
-
None
Seen on Mongo 2.5.1.
Say you have this object
class Article include Mongoid::Document field :simple_field field :some_metadata, type: Hash end
Then the
Unable to find source-code formatter for language: update_attributes```. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
will silently fail.
ruby
article = Article.new :simple_field => 'foo'
article.save
article.update_attributes :simple_field => 'bar', some_metadata =>
{ "datum.1" => "value" }h1. In memory, everything's fine
puts article.simple_field # bar
puts article.some_metadata # { "datum.1" => "value" }
But when you read fields from the database
puts article.reload.simple_field # foo
puts article.reload.some_metadata # nil
Shouldn't mongoid escape hash keys containing
.
or
$` before storing them in mongoid?