AndMatchExpression.js 1.9 KB

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