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