ExistsMatchExpression.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. "use strict";
  2. var LeafMatchExpression = require('./LeafMatchExpression');
  3. // Autogenerated by cport.py on 2013-09-17 14:37
  4. var ExistsMatchExpression = module.exports = function ExistsMatchExpression(){
  5. this._matchType = 'EXISTS';
  6. }, klass = ExistsMatchExpression, base = LeafMatchExpression, 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_leaf.cpp lines: 286-294
  16. return this._debugAddSpace( level ) + this.path() + " exists" + (this.getTag() ? " " + this.getTag().debugString() : "") + "\n";
  17. };
  18. /**
  19. *
  20. * This documentation was automatically generated. Please update when you touch this function.
  21. * @method equivalent
  22. * @param
  23. *
  24. */
  25. proto.equivalent = function equivalent( other ) { // const MatchExpression* other
  26. // File: expression_leaf.cpp lines: 297-302
  27. if(this._matchType != other._matchType) {
  28. return false;
  29. }
  30. return this.path() == other.path();
  31. };
  32. /**
  33. *
  34. * This documentation was automatically generated. Please update when you touch this function.
  35. * @method init
  36. * @param
  37. *
  38. */
  39. proto.init = function init( path ) { // const StringData& path
  40. // File: expression_leaf.cpp lines: 278-279
  41. return this.initPath( path );
  42. };
  43. /**
  44. *
  45. * This documentation was automatically generated. Please update when you touch this function.
  46. * @method matchesSingleElement
  47. * @param
  48. *
  49. */
  50. proto.matchesSingleElement = function matchesSingleElement( e ) { // const BSONElement& e
  51. // File: expression_leaf.cpp lines: 282-283
  52. return !(typeof(e) == 'object') || Object.keys(e).length > 0;
  53. };
  54. /**
  55. *
  56. * This documentation was automatically generated. Please update when you touch this function.
  57. * @method shallowClone
  58. * @param
  59. *
  60. */
  61. proto.shallowClone = function shallowClone( /* */ ){
  62. // File: expression_leaf.h lines: 220-223
  63. var e = new ExistsMatchExpression();
  64. e.init(this.path());
  65. return e;
  66. };