Maslosoft Mangan API
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842
<?php
/**
* This software package is licensed under AGPL or Commercial license.
*
* @package maslosoft/mangan
* @licence AGPL or Commercial
* @copyright Copyright (c) Piotr Masełkowski <pmaselkowski@gmail.com>
* @copyright Copyright (c) Maslosoft
* @copyright Copyright (c) Others as mentioned in code
* @link https://maslosoft.com/mangan/
*/
namespace Maslosoft\Mangan\Traits;
/**
* AvailableCommands
*
* @author Piotr Maselkowski <pmaselkowski at gmail.com>
*/
trait AvailableCommands
{
abstract public function call($command, $arguments = []);
/**
* { _isSelf : 1 } INTERNAL ONLY
*/
public function _isSelf()
{
return $this->call('_isSelf', func_get_args());
}
/**
* { pipeline: [ { $operator: {...}}, ... ], explain: <bool>, allowDiskUse: <bool>, cursor: {batchSize: <number>} }
* See http://dochub.mongodb.org/core/aggregation for more details.
*/
public function aggregate()
{
return $this->call('aggregate', func_get_args());
}
/**
* internal (sharding)
* { applyOps : [ ] , preCondition : [ { ns : ... , q : ... , res : ... } ] }
*/
public function applyOps()
{
return $this->call('applyOps', func_get_args());
}
/**
* internal
*/
public function authenticate()
{
return $this->call('authenticate', func_get_args());
}
/**
* no help defined
*/
public function availableQueryOptions()
{
return $this->call('availableQueryOptions', func_get_args());
}
/**
* get version #, etc.
* { buildinfo:1 }
*/
public function buildInfo()
{
return $this->call('buildInfo', func_get_args());
}
/**
* Internal command.
*
*/
public function checkShardingIndex()
{
return $this->call('checkShardingIndex', func_get_args());
}
/**
* clone this database from an instance of the db on another host
* {clone: "host13"[, slaveOk: <bool>]}
*/
public function cloneDb()
{
return $this->call('clone', func_get_args());
}
/**
* { cloneCollection: <collection>, from: <host> [,query: <query_filter>] [,copyIndexes:<bool>] }
* Copies a collection from one server to another. Do not use on a single server as the destination is placed at the same db.collection (namespace) as the source.
*
*/
public function cloneCollection()
{
return $this->call('cloneCollection', func_get_args());
}
/**
* { cloneCollectionAsCapped:<fromName>, toCollection:<toName>, size:<sizeInBytes> }
*/
public function cloneCollectionAsCapped()
{
return $this->call('cloneCollectionAsCapped', func_get_args());
}
/**
* Sets collection options.
* Example: { collMod: 'foo', usePowerOf2Sizes:true }
* Example: { collMod: 'foo', index: {keyPattern: {a: 1}, expireAfterSeconds: 600} Example: { collMod: 'foo', index: {name: 'bar', expireAfterSeconds: 600} }
*
*/
public function collMod()
{
return $this->call('collMod', func_get_args());
}
/**
* { collStats:"blog.posts" , scale : 1 } scale divides sizes e.g. for KB use 1024
* avgObjSize - in bytes
*/
public function collStats()
{
return $this->call('collStats', func_get_args());
}
/**
* compact collection
* warning: this operation locks the database and is slow. you can cancel with killOp()
* { compact : <collection_name>, [force:<bool>], [validate:<bool>],
* [paddingFactor:<num>], [paddingBytes:<num>] }
* force - allows to run on a replica set primary
* validate - check records are noncorrupt before adding to newly compacting extents. slower but safer (defaults to true in this version)
*
*/
public function compact()
{
return $this->call('compact', func_get_args());
}
/**
* stats about connections between servers in a replica set or sharded cluster.
*/
public function connPoolStats()
{
return $this->call('connPoolStats', func_get_args());
}
/**
* internal
*/
public function connPoolSync()
{
return $this->call('connPoolSync', func_get_args());
}
/**
* Returns connection-specific information such as logged-in users and their roles
*/
public function connectionStatus()
{
return $this->call('connectionStatus', func_get_args());
}
/**
* { convertToCapped:<fromCollectionName>, size:<sizeInBytes> }
*/
public function convertToCapped()
{
return $this->call('convertToCapped', func_get_args());
}
/**
* count objects in collection
*/
public function count()
{
return $this->call('count', func_get_args());
}
/**
* create a collection explicitly
* { create: <ns>[, capped: <bool>, size: <collSizeInBytes>, max: <nDocs>] }
*/
public function create()
{
return $this->call('create', func_get_args());
}
/**
* no help defined
*/
public function createIndexes()
{
return $this->call('createIndexes', func_get_args());
}
/**
* Adds a role to the system
*
*/
public function createRole()
{
return $this->call('createRole', func_get_args());
}
/**
* Adds a user to the system
*
*/
public function createUser()
{
return $this->call('createUser', func_get_args());
}
/**
* no help defined
*/
public function currentOpCtx()
{
return $this->call('currentOpCtx', func_get_args());
}
/**
* determine data size for a set of data in a certain range
* example: { dataSize:"blog.posts", keyPattern:{x:1}, min:{x:10}, max:{x:55} }
* min and max parameters are optional. They must either both be included or both omitted
* keyPattern is an optional parameter indicating an index pattern that would be usefulfor iterating over the min/max bounds. If keyPattern is omitted, it is inferred from the structure of min.
* note: This command may take a while to run
*/
public function dataSize()
{
return $this->call('dataSize', func_get_args());
}
/**
* no help defined
*/
public function dbHash()
{
return $this->call('dbHash', func_get_args());
}
/**
* Get stats on a database. Not instantaneous. Slower for databases with large .ns files.
* Example: { dbStats:1, scale:1 }
*/
public function dbStats()
{
return $this->call('dbStats', func_get_args());
}
/**
* delete documents
*/
public function delete()
{
return $this->call('delete', func_get_args());
}
/**
* { distinct : 'collection name' , key : 'a.b' , query : {} }
*/
public function distinct()
{
return $this->call('distinct', func_get_args());
}
/**
* no help defined
*/
public function driverOIDTest()
{
return $this->call('driverOIDTest', func_get_args());
}
/**
* drop a collection
* {drop : <collectionName>}
*/
public function drop()
{
return $this->call('drop', func_get_args());
}
/**
* Drops all roles from the given database. Before deleting the roles completely it must remove them from any users or other roles that reference them. If any errors occur in the middle of that process it's possible to be left in a state where the roles have been removed from some user/roles but otherwise still exist.
*
*/
public function dropAllRolesFromDatabase()
{
return $this->call('dropAllRolesFromDatabase', func_get_args());
}
/**
* Drops all users for a single database.
*
*/
public function dropAllUsersFromDatabase()
{
return $this->call('dropAllUsersFromDatabase', func_get_args());
}
/**
* drop (delete) this database
*/
public function dropDatabase()
{
return $this->call('dropDatabase', func_get_args());
}
/**
* drop indexes for a collection
*/
public function dropIndexes()
{
return $this->call('dropIndexes', func_get_args());
}
/**
* Drops a single role. Before deleting the role completely it must remove it from any users or roles that reference it. If any errors occur in the middle of that process it's possible to be left in a state where the role has been removed from some user/roles but otherwise still exists.
*
*/
public function dropRole()
{
return $this->call('dropRole', func_get_args());
}
/**
* Drops a single user.
*
*/
public function dropUser()
{
return $this->call('dropUser', func_get_args());
}
/**
* DEPRECATED
* Evaluate javascript at the server.
* http://dochub.mongodb.org/core/serversidecodeexecution
*/
public function evalJs()
{
return $this->call('eval', func_get_args());
}
/**
* explain database reads and writes
*/
public function explain()
{
return $this->call('explain', func_get_args());
}
/**
* return build level feature settings
*/
public function features()
{
return $this->call('features', func_get_args());
}
/**
* example: { filemd5 : ObjectId(aaaaaaa) , root : "fs" }
*/
public function filemd5()
{
return $this->call('filemd5', func_get_args());
}
/**
* query for documents
*/
public function find()
{
return $this->call('find', func_get_args());
}
/**
* { findAndModify: "collection", query: {processed:false}, update: {$set: {processed:true}}, new: true}
* { findAndModify: "collection", query: {processed:false}, remove: true, sort: {priority:-1}}
* Either update or remove is required, all other fields have default values.
* Output is in the "value" field
*
*/
public function findAndModify()
{
return $this->call('findAndModify', func_get_args());
}
/**
* for testing purposes only. forces a user assertion exception
*/
public function forceerror()
{
return $this->call('forceerror', func_get_args());
}
/**
* http://dochub.mongodb.org/core/geo#GeospatialIndexing-geoNearCommand
*/
public function geoNear()
{
return $this->call('geoNear', func_get_args());
}
/**
* no help defined
*/
public function geoSearch()
{
return $this->call('geoSearch', func_get_args());
}
/**
* return error status of the last operation on this connection
* options:
* { fsync:true } - fsync before returning, or wait for journal commit if running with --journal
* { j:true } - wait for journal commit if running with --journal
* { w:n } - await replication to n servers (including self) before returning
* { w:'majority' } - await replication to majority of set
* { wtimeout:m} - timeout for w in m milliseconds
*/
public function getLastError()
{
return $this->call('getLastError', func_get_args());
}
/**
* retrieve more results from an existing cursor
*/
public function getMore()
{
return $this->call('getMore', func_get_args());
}
/**
* check for errors since last reseterror commandcal
*/
public function getPrevError()
{
return $this->call('getPrevError', func_get_args());
}
/**
* internal
*/
public function getnonce()
{
return $this->call('getnonce', func_get_args());
}
/**
* Grants privileges to a role
*
*/
public function grantPrivilegesToRole()
{
return $this->call('grantPrivilegesToRole', func_get_args());
}
/**
* Grants roles to another role.
*
*/
public function grantRolesToRole()
{
return $this->call('grantRolesToRole', func_get_args());
}
/**
* Grants roles to a user.
*
*/
public function grantRolesToUser()
{
return $this->call('grantRolesToUser', func_get_args());
}
/**
* http://dochub.mongodb.org/core/aggregation
*/
public function group()
{
return $this->call('group', func_get_args());
}
/**
* internal
*/
public function handshake()
{
return $this->call('handshake', func_get_args());
}
/**
* returns information about the daemon's host
*/
public function hostInfo()
{
return $this->call('hostInfo', func_get_args());
}
/**
* insert documents
*/
public function insert()
{
return $this->call('insert', func_get_args());
}
/**
* Check if this server is primary for a replica pair/set; also if it is --master or --slave in simple master/slave setups.
* { isMaster : 1 }
*/
public function isMaster()
{
return $this->call('isMaster', func_get_args());
}
/**
* kill a list of cursor ids
*/
public function killCursors()
{
return $this->call('killCursors', func_get_args());
}
/**
* list collections for this db
*/
public function listCollections()
{
return $this->call('listCollections', func_get_args());
}
/**
* get a list of all db commands
*/
public function listCommands()
{
return $this->call('listCommands', func_get_args());
}
/**
* list indexes for a collection
*/
public function listIndexes()
{
return $this->call('listIndexes', func_get_args());
}
/**
* de-authenticate
*/
public function logout()
{
return $this->call('logout', func_get_args());
}
/**
* Run a map/reduce operation on the server.
* Note this is used for aggregation, not querying, in MongoDB.
* http://dochub.mongodb.org/core/mapreduce
*/
public function mapReduce()
{
return $this->call('mapReduce', func_get_args());
}
/**
* internal
*/
public function mapReduceShardedFinish()
{
return $this->call('mapreduce.shardedfinish', func_get_args());
}
/**
* no help defined
*/
public function parallelCollectionScan()
{
return $this->call('parallelCollectionScan', func_get_args());
}
/**
* a way to check that the server is alive. responds immediately even if server is in a db lock.
*/
public function ping()
{
return $this->call('ping', func_get_args());
}
/**
* Drops one or all cached queries in a collection.
*/
public function planCacheClear()
{
return $this->call('planCacheClear', func_get_args());
}
/**
* Clears index filter for a single query shape or, if the query shape is omitted, all filters for the collection.
*/
public function planCacheClearFilters()
{
return $this->call('planCacheClearFilters', func_get_args());
}
/**
* Displays index filters for all query shapes in a collection.
*/
public function planCacheListFilters()
{
return $this->call('planCacheListFilters', func_get_args());
}
/**
* Displays the cached plans for a query shape.
*/
public function planCacheListPlans()
{
return $this->call('planCacheListPlans', func_get_args());
}
/**
* Displays all query shapes in a collection.
*/
public function planCacheListQueryShapes()
{
return $this->call('planCacheListQueryShapes', func_get_args());
}
/**
* Sets index filter for a query shape. Overrides existing filter.
*/
public function planCacheSetFilter()
{
return $this->call('planCacheSetFilter', func_get_args());
}
/**
* enable or disable performance profiling
* { profile : <n> }
* 0=off 1=log slow ops 2=log all
* -1 to get current values
* http://docs.mongodb.org/manual/reference/command/profile/#dbcmd.profile
*/
public function profile()
{
return $this->call('profile', func_get_args());
}
/**
* re-index a collection
*/
public function reIndex()
{
return $this->call('reIndex', func_get_args());
}
/**
* no help defined
*/
public function repairCursor()
{
return $this->call('repairCursor', func_get_args());
}
/**
* repair database. also compacts. note: slow.
*/
public function repairDatabase()
{
return $this->call('repairDatabase', func_get_args());
}
/**
* reset error state (used with getpreverror)
*/
public function resetError()
{
return $this->call('resetError', func_get_args());
}
/**
* Revokes privileges from a role
*
*/
public function revokePrivilegesFromRole()
{
return $this->call('revokePrivilegesFromRole', func_get_args());
}
/**
* Revokes roles from another role.
*
*/
public function revokeRolesFromRole()
{
return $this->call('revokeRolesFromRole', func_get_args());
}
/**
* Revokes roles from a user.
*
*/
public function revokeRolesFromUser()
{
return $this->call('revokeRolesFromUser', func_get_args());
}
/**
* Returns information about roles.
*
*/
public function rolesInfo()
{
return $this->call('rolesInfo', func_get_args());
}
/**
* Subsequent steps in a SASL authentication conversation.
*/
public function saslContinue()
{
return $this->call('saslContinue', func_get_args());
}
/**
* First step in a SASL authentication conversation.
*/
public function saslStart()
{
return $this->call('saslStart', func_get_args());
}
/**
* returns lots of administrative server statistics
*/
public function serverStatus()
{
return $this->call('serverStatus', func_get_args());
}
/**
* stats about the shard connection pool
*/
public function shardConnPoolStats()
{
return $this->call('shardConnPoolStats', func_get_args());
}
/**
* Internal command.
* examples:
* { splitVector : "blog.post" , keyPattern:{x:1} , min:{x:10} , max:{x:20}, maxChunkSize:200 }
* maxChunkSize unit in MBs
* May optionally specify 'maxSplitPoints' and 'maxChunkObjects' to avoid traversing the whole chunk
*
* { splitVector : "blog.post" , keyPattern:{x:1} , min:{x:10} , max:{x:20}, force: true }
* 'force' will produce one split point even if data is small; defaults to false
* NOTE: This command may take a while to run
*/
public function splitVector()
{
return $this->call('splitVector', func_get_args());
}
/**
* touch collection
* Page in all pages of memory containing every extent for the given collection
* { touch : <collection_name>, [data : true] , [index : true] }
* at least one of data or index must be true; default is both are false
*
*/
public function touch()
{
return $this->call('touch', func_get_args());
}
/**
* update documents
*/
public function update()
{
return $this->call('update', func_get_args());
}
/**
* Used to update a role
*
*/
public function updateRole()
{
return $this->call('updateRole', func_get_args());
}
/**
* Used to update a user, for example to change its password
*
*/
public function updateUser()
{
return $this->call('updateUser', func_get_args());
}
/**
* Returns information about users.
*
*/
public function usersInfo()
{
return $this->call('usersInfo', func_get_args());
}
/**
* Validate contents of a namespace by scanning its data structures for correctness. Slow.
* Add full:true option to do a more thorough check
*/
public function validate()
{
return $this->call('validate', func_get_args());
}
/**
* {whatsmyuri:1}
*/
public function whatsmyuri()
{
return $this->call('whatsmyuri', func_get_args());
}
}
API documentation generated by ApiGen