deprecate JavaScript string for Collection#find

This commit is contained in:
Kyle Banker 2010-05-07 15:12:53 -04:00
parent d68e42812e
commit 3209ca05fd
1 changed files with 4 additions and 0 deletions

View File

@ -300,8 +300,12 @@ module Mongo
when nil
{}
when BSON::Code
warn "Collection#find will no longer take a JavaScript string in future versions. " +
"Please specify your $where query explicitly."
{"$where" => selector}
when String
warn "Collection#find will no longer take a JavaScript string in future versions. " +
"Please specify your $where query explicitly."
{"$where" => BSON::Code.new(selector)}
end
end