Closed fabriciocolombo closed 11 years ago
Though I appreciate your proposal, I was looking to check which commands are provided by the mongo shell, and provide them all at once in an addition to TMongoWire. Your code did give me some idea's, for example BSON() should accept and ignore any 'nil' values, so you could write BSON(['$explain',true,'query',Query,'orderby',OrderBy]) and not longer need a local variable and an if statement.
Yes, this would produce cleaner code. About the "orderby", he results the same effect as the special field "$orderby".
There are two other options that can influence the outcome of "$explain" and could be used to run a query: $hint and $snapshot.
Hmm, do you know about 'VarArrayOf([...])'? I'll check the AV somewhere in the next few weeks.
Really, I had forgotten VarArrayOf. Here is where the AV is raised: https://github.com/fabriciocolombo/TMongoWire/commit/992191ea09a0f6dd5ea7fcbf5bb37abd98f8cc84
Thank you. Found it. Looks like any directly nested arrays would have had trouble.
Implementation of explain method in TMongoWireQuery class.