OrMatchExpression.js 1.9 KB

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