{"issue":{"title":"Mongoose saves Documents Relations with '$' that makes find() impossible","user":{"login":"kthakore","id":21407,"url":"https://api.github.com/users/kthakore","avatar_url":"https://secure.gravatar.com/avatar/84ceb0c3fe31a736c4b44ff4327e4a10?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"84ceb0c3fe31a736c4b44ff4327e4a10"},"created_at":"2011-12-28T00:35:48Z","milestone":null,"labels":[],"state":"closed","updated_at":"2011-12-28T14:42:23Z","id":2668029,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":"2011-12-28T14:42:23Z","html_url":"https://github.com/rodrigolive/mongoose/issues/16","body":"```\r\npackage Bar; \r\nuse Moose; \r\nwith 'Mongoose::Document'; \r\nhas 'stuff' => (is => 'rw', isa => 'Str', required => 1 ); \r\n1; \r\n\r\npackage Foo; \r\nuse Moose; \r\nwith 'Mongoose::Document'; \r\nhas 'other_stuff' => (is => 'rw', isa => 'Str' ); \r\nhas 'bars' => (is => 'rw', isa => 'Bar' ); \r\n1; \r\n```\r\n\r\nThis is saved as: \r\n\r\n```\r\n{ \"bar\" : { '$ref' : '...', '$id': '4e9ac....'  ....\r\n\r\n```\r\nThe problem with this is I can't do:\r\n\r\n``` db.foo_bar.find( { \"bar\" : { \"$ref\" : { \"$oid\" : \"4e9ac ... ```\r\n\r\nThat is JSON error as '$' is an operation in the query syntax for MongoDB  for example '$ne' ... \r\n\r\nThis is a big problem because it prevents find from working and we have to do a foreach and do a search in Perl which is slower. Can we not use '_' instead there?\r\n\r\n\r\n\r\n\r\n","number":16,"url":"https://api.github.com/repos/rodrigolive/mongoose/issues/16","comments":0,"assignee":null},"action":"closed"}