AndMatchExpression.js 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. "use strict";
  2. var ListOfMatchExpression = require('./ListOfMatchExpression');
  3. // Autogenerated by cport.py on 2013-09-17 14:37
  4. var AndMatchExpression = module.exports = function AndMatchExpression(){
  5. this._expressions = [];
  6. this._matchType = 'AND';
  7. }, klass = AndMatchExpression, base = ListOfMatchExpression, proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  8. /**
  9. *
  10. * This documentation was automatically generated. Please update when you touch this function.
  11. * @method debugString
  12. * @param
  13. *
  14. */
  15. proto.debugString = function debugString( level ) { // StringBuilder& debug, int level
  16. // File: expression_tree.cpp lines: 85-88
  17. return this._debugAddSpace(level) + "$and\n" + this._debugList(level);
  18. };
  19. /**
  20. *
  21. * This documentation was automatically generated. Please update when you touch this function.
  22. * @method matches
  23. * @param
  24. *
  25. */
  26. proto.matches = function matches( doc, details ) { // const MatchableDocument* doc, MatchDetails* details
  27. // File: expression_tree.cpp lines: 64-72
  28. var tChild;
  29. for (var i = 0; i < this.numChildren(); i++) {
  30. tChild = this.getChild(i);
  31. if ( ! tChild.matches(doc,details)) {
  32. if (details) {
  33. details.resetOutput();
  34. }
  35. return false;
  36. } else {
  37. debugger;
  38. }
  39. }
  40. return true;
  41. };
  42. /**
  43. *
  44. * This documentation was automatically generated. Please update when you touch this function.
  45. * @method matchesSingleElement
  46. * @param
  47. *
  48. */
  49. proto.matchesSingleElement = function matchesSingleElement( e ){ // const BSONElement& e
  50. // File: expression_tree.cpp lines: 75-81
  51. for (var i = 0; i < this.numChildren(); i++) {
  52. if (!this.getChild(i).matchesSingleElement(e)) {
  53. return false;
  54. }
  55. }
  56. return true;
  57. };
  58. /**
  59. *
  60. * This documentation was automatically generated. Please update when you touch this function.
  61. * @method shallowClone
  62. * @param
  63. *
  64. */
  65. proto.shallowClone = function shallowClone( /* */ ){
  66. // File: expression_tree.h lines: 67-72
  67. var e = new AndMatchExpression();
  68. for (var i = 0; i < this.numChildren(); i++) {
  69. e.add(this.getChild(i).shallowClone());
  70. }
  71. };