ArrayMatchingMatchExpression.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. "use strict"
  2. // Autogenerated by cport.py on 2013-09-17 14:37
  3. var ArrayMatchingMatchExpression = module.exports = function (){
  4. }, klass = ArrayMatchingMatchExpression, base = Object , proto = klass.prototype = Object.create(base.prototype, {constructor:{value:klass}});
  5. // File: expression_array.h lines: 55-55
  6. // ElementPath _elementPath;
  7. proto._elementPath = undefined;
  8. // File: expression_array.h lines: 54-54
  9. // StringData _path;
  10. proto._path = undefined;
  11. // File: expression_array.h lines: 55-55
  12. // ElementPath _elementPath;
  13. proto._elementPath = undefined;
  14. // File: expression_array.h lines: 54-54
  15. // StringData _path;
  16. proto._path = undefined;
  17. /**
  18. *
  19. * This documentation was automatically generated. Please update when you touch this function.
  20. * @method ArrayMatchingMatchExpression
  21. * @param
  22. *
  23. */
  24. proto.ArrayMatchingMatchExpression = function ArrayMatchingMatchExpression( /* MatchType matchType */ ){
  25. // File: expression_array.h lines: 36-35
  26. // ArrayMatchingMatchExpression( MatchType matchType ) : MatchExpression( matchType ){}
  27. }
  28. /**
  29. *
  30. * This documentation was automatically generated. Please update when you touch this function.
  31. * @method equivalent
  32. * @param
  33. *
  34. */
  35. proto.equivalent = function equivalent( /* const MatchExpression* other */ ){
  36. // File: expression_array.cpp lines: 63-79
  37. // bool ArrayMatchingMatchExpression::equivalent( const MatchExpression* other ) const {
  38. // if ( matchType() != other->matchType() )
  39. // return false;
  40. //
  41. // const ArrayMatchingMatchExpression* realOther =
  42. // static_cast<const ArrayMatchingMatchExpression*>( other );
  43. //
  44. // if ( _path != realOther->_path )
  45. // return false;
  46. //
  47. // if ( numChildren() != realOther->numChildren() )
  48. // return false;
  49. //
  50. // for ( unsigned i = 0; i < numChildren(); i++ )
  51. // if ( !getChild(i)->equivalent( realOther->getChild(i) ) )
  52. // return false;
  53. // return true;
  54. // }
  55. }
  56. /**
  57. *
  58. * This documentation was automatically generated. Please update when you touch this function.
  59. * @method initPath
  60. * @param
  61. *
  62. */
  63. proto.initPath = function initPath( /* const StringData& path */ ){
  64. // File: expression_array.cpp lines: 27-31
  65. // Status ArrayMatchingMatchExpression::initPath( const StringData& path ) {
  66. // _path = path;
  67. // Status s = _elementPath.init( _path );
  68. // _elementPath.setTraverseLeafArray( false );
  69. // return s;
  70. // }
  71. }
  72. /**
  73. *
  74. * This documentation was automatically generated. Please update when you touch this function.
  75. * @method matches
  76. * @param
  77. *
  78. */
  79. proto.matches = function matches( /* const MatchableDocument* doc, MatchDetails* details */ ){
  80. // File: expression_array.cpp lines: 34-53
  81. // bool ArrayMatchingMatchExpression::matches( const MatchableDocument* doc, MatchDetails* details ) const {
  82. //
  83. // boost::scoped_ptr<ElementIterator> cursor( doc->getIterator( _elementPath ) );
  84. //
  85. // while ( cursor->more() ) {
  86. // ElementIterator::Context e = cursor->next();
  87. // if ( e.element().type() != Array )
  88. // continue;
  89. //
  90. // bool amIRoot = e.arrayOffset().eoo();
  91. //
  92. // if ( !matchesArray( e.element().Obj(), amIRoot ? details : NULL ) )
  93. // continue;
  94. //
  95. // if ( !amIRoot && details && details->needRecord() && !e.arrayOffset().eoo() ) {
  96. // details->setElemMatchKey( e.arrayOffset().fieldName() );
  97. // }
  98. // return true;
  99. // }
  100. // return false;
  101. // }
  102. }
  103. /**
  104. *
  105. * This documentation was automatically generated. Please update when you touch this function.
  106. * @method matchesSingleElement
  107. * @param
  108. *
  109. */
  110. proto.matchesSingleElement = function matchesSingleElement( /* const BSONElement& e */ ){
  111. // File: expression_array.cpp lines: 56-59
  112. // bool ArrayMatchingMatchExpression::matchesSingleElement( const BSONElement& e ) const {
  113. // if ( e.type() != Array )
  114. // return false;
  115. // return matchesArray( e.Obj(), NULL );
  116. // }
  117. }
  118. /**
  119. *
  120. * This documentation was automatically generated. Please update when you touch this function.
  121. * @method path
  122. * @param
  123. *
  124. */
  125. proto.path = function path( /* */ ){
  126. // File: expression_array.h lines: 52-51
  127. // const StringData path() const { return _path; }
  128. }
  129. /**
  130. *
  131. * This documentation was automatically generated. Please update when you touch this function.
  132. * @method ~ArrayMatchingMatchExpression
  133. * @param
  134. *
  135. */
  136. proto.~ArrayMatchingMatchExpression = function ~ArrayMatchingMatchExpression( /* */ ){
  137. // File: expression_array.h lines: 37-36
  138. // virtual ~ArrayMatchingMatchExpression(){}
  139. }