diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-27 16:23:07 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-27 16:23:07 -0400 |
commit | ef6bc688823ec3cb3cb8ccb60467afe11ddc82b2 (patch) | |
tree | 394206ccd59dcf17a763039d25fa469fa7bcf5f8 /scripting/engine_v8.cpp | |
parent | d27c8505eac9299b517538d97cd5ead4d185d1f6 (diff) | |
download | mongo-ef6bc688823ec3cb3cb8ccb60467afe11ddc82b2.tar.gz |
handle numeric types better
Diffstat (limited to 'scripting/engine_v8.cpp')
-rw-r--r-- | scripting/engine_v8.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/scripting/engine_v8.cpp b/scripting/engine_v8.cpp index 512f524470a..064daf54988 100644 --- a/scripting/engine_v8.cpp +++ b/scripting/engine_v8.cpp @@ -164,6 +164,14 @@ namespace mongo { return get( field )->ToNumber()->Value(); } + int V8Scope::getNumberInt( const char *field ){ + return get( field )->ToInt32()->Value(); + } + + long long V8Scope::getNumberLongLong( const char *field ){ + return get( field )->ToInteger()->Value(); + } + string V8Scope::getString( const char *field ){ return toSTLString( get( field ) ); } |