summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTad Marshall <tad@10gen.com>2013-02-19 13:39:04 -0500
committerTad Marshall <tad@10gen.com>2013-02-19 15:35:01 -0500
commit1d9112158860663ca0336dea85dadda88b865bc2 (patch)
tree7b32f1974ec4ed4ab4f96cab51d3f5f2c95f3881
parentdd950a095b760d3eef53c2273b4c20f9c90b8b04 (diff)
downloadmongo-1d9112158860663ca0336dea85dadda88b865bc2.tar.gz
SERVER-8247 Add ES5 functions to autocomplete lists
-rw-r--r--src/mongo/shell/utils.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js
index 5be16f28747..be4f1a2c3cf 100644
--- a/src/mongo/shell/utils.js
+++ b/src/mongo/shell/utils.js
@@ -567,20 +567,21 @@ shellAutocomplete = function ( /*prefix*/ ) { // outer scope function called on
var universalMethods = "constructor prototype toString valueOf toLocaleString hasOwnProperty propertyIsEnumerable".split( ' ' );
var builtinMethods = {}; // uses constructor objects as keys
- builtinMethods[Array] = "length concat join pop push reverse shift slice sort splice unshift indexOf lastIndexOf every filter forEach map some".split( ' ' );
+ builtinMethods[Array] = "length concat join pop push reverse shift slice sort splice unshift indexOf lastIndexOf every filter forEach map some isArray reduce reduceRight".split( ' ' );
builtinMethods[Boolean] = "".split( ' ' ); // nothing more than universal methods
- builtinMethods[Date] = "getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear parse setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear toDateString toGMTString toLocaleDateString toLocaleTimeString toTimeString toUTCString UTC".split( ' ' );
- builtinMethods[Math] = "E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2 abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan".split( ' ' );
+ builtinMethods[Date] = "getDate getDay getFullYear getHours getMilliseconds getMinutes getMonth getSeconds getTime getTimezoneOffset getUTCDate getUTCDay getUTCFullYear getUTCHours getUTCMilliseconds getUTCMinutes getUTCMonth getUTCSeconds getYear parse setDate setFullYear setHours setMilliseconds setMinutes setMonth setSeconds setTime setUTCDate setUTCFullYear setUTCHours setUTCMilliseconds setUTCMinutes setUTCMonth setUTCSeconds setYear toDateString toGMTString toISOString toLocaleDateString toLocaleTimeString toTimeString toUTCString UTC now".split( ' ' );
+ builtinMethods[JSON] = "parse stringify".split(' ');
+ builtinMethods[Math] = "E LN2 LN10 LOG2E LOG10E PI SQRT1_2 SQRT2 abs acos asin atan atan2 ceil cos exp floor log max min pow random round sin sqrt tan".split(' ');
builtinMethods[Number] = "MAX_VALUE MIN_VALUE NEGATIVE_INFINITY POSITIVE_INFINITY toExponential toFixed toPrecision".split( ' ' );
builtinMethods[RegExp] = "global ignoreCase lastIndex multiline source compile exec test".split( ' ' );
- builtinMethods[String] = "length charAt charCodeAt concat fromCharCode indexOf lastIndexOf match replace search slice split substr substring toLowerCase toUpperCase".split( ' ' );
- builtinMethods[Function] = "call apply".split( ' ' );
- builtinMethods[Object] = "bsonsize".split( ' ' );
+ builtinMethods[String] = "length charAt charCodeAt concat fromCharCode indexOf lastIndexOf match replace search slice split substr substring toLowerCase toUpperCase trim trimLeft trimRight".split(' ');
+ builtinMethods[Function] = "call apply bind".split( ' ' );
+ builtinMethods[Object] = "bsonsize create defineProperty defineProperties getPrototypeOf keys seal freeze preventExtensions isSealed isFrozen isExtensible getOwnPropertyDescriptor getOwnPropertyNames".split(' ');
- builtinMethods[Mongo] = "find update insert remove".split( ' ' );
- builtinMethods[BinData] = "hex base64 length subtype".split( ' ' );
+ builtinMethods[Mongo] = "find update insert remove".split(' ');
+ builtinMethods[BinData] = "hex base64 length subtype".split(' ');
- var extraGlobals = "Infinity NaN undefined null true false decodeURI decodeURIComponent encodeURI encodeURIComponent escape eval isFinite isNaN parseFloat parseInt unescape Array Boolean Date Math Number RegExp String print load gc MinKey MaxKey Mongo NumberInt NumberLong ObjectId DBPointer UUID BinData HexData MD5 Map Timestamp".split( ' ' );
+ var extraGlobals = "Infinity NaN undefined null true false decodeURI decodeURIComponent encodeURI encodeURIComponent escape eval isFinite isNaN parseFloat parseInt unescape Array Boolean Date Math Number RegExp String print load gc MinKey MaxKey Mongo NumberInt NumberLong ObjectId DBPointer UUID BinData HexData MD5 Map Timestamp JSON".split( ' ' );
var isPrivate = function( name ) {
if ( shellAutocomplete.showPrivate ) return false;