ExistsMatchExpression.js 2.1 KB

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