OrMatchExpression.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. "use strict";
  2. ListOfMatchExpression = require('ListOfMatchExpression');
  3. // Autogenerated by cport.py on 2013-09-17 14:37
  4. var OrMatchExpression = module.exports = function OrMatchExpression (){
  5. this._matchType = 'OR';
  6. }, klass = OrMatchExpression, base = ListOfMatchExpression, 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: 112-115
  16. return this._debugAddSpace( level ) + "$or\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: 93-99
  27. for (var i = 0; i < this.numChildren(); i++) {
  28. if (this.getChild(i).matches( doc, null ) ){
  29. return true;
  30. }
  31. }
  32. };
  33. /**
  34. *
  35. * This documentation was automatically generated. Please update when you touch this function.
  36. * @method matchesSingleElement
  37. * @param
  38. *
  39. */
  40. proto.matchesSingleElement = function matchesSingleElement( e ) { // const BSONElement& e
  41. // File: expression_tree.cpp lines: 102-108
  42. for (var i = 0; i < this.numChildren(); i++) {
  43. if( this.getChild(i).matchesSingleElement(e) ) {
  44. return true;
  45. }
  46. }
  47. return false;
  48. };
  49. /**
  50. *
  51. * This documentation was automatically generated. Please update when you touch this function.
  52. * @method shallowClone
  53. * @param
  54. *
  55. */
  56. proto.shallowClone = function shallowClone( /* */ ){
  57. // File: expression_tree.h lines: 86-91
  58. clone = new OrMatchExpression();
  59. for (var i = 0; i < this.numChildren(); i++) {
  60. clone.add(this.getChild(i).shallowClone());
  61. }
  62. return clone;
  63. }