This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = connect(url); | |
var collections = db.getCollectionNames(); | |
collections.forEach((table)=>{ | |
var commands = []; | |
var indexes = db[table].getIndexes(); | |
if(indexes.length>0){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = connect(url); | |
var dbName = db.getName(); | |
print(`Database: ${dbName}`); | |
var collections = db.getCollectionNames() | |
collections.forEach((table)=>{ | |
var commands = []; | |
var indexes = db[table].getIndexes(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use taskcenter | |
var collections = db.getCollectionNames() | |
collections.forEach((tableName)=>{ | |
if(tableName !=="system.profile"){ | |
print(`db.${tableName}.dropIndexes()`); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.currentOp( | |
{ | |
$or: [ | |
{ op: "command", "query.createIndexes": { $exists: true } } | |
] | |
} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis-cli KEYS "prefix:*" | xargs redis-cli DEL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in `redis-cli KEYS "keyPrefix:*" | awk -F'"' '{print $1}'`;do redis-cli hset $i fieldName "2";done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
upstream weblist { | |
server 192.168.1.2:80 weight=1; | |
server 192.168.1.3:80 weight=1; | |
} | |
server { | |
listen 8080 | |
default_server; | |
server_name _; | |
location /cache { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
TableName = t.name, | |
IndexName = ind.name, | |
IndexId = ind.index_id, | |
ColumnId = ic.index_column_id, | |
ColumnName = col.name, | |
ind.*, | |
ic.*, | |
col.* | |
FROM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET STATISTICS PROFILE ON | |
SET STATISTICS IO ON | |
SET STATISTICS Time ON |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (window.getSelection) { | |
if (window.getSelection().empty) { // Chrome | |
window.getSelection().empty(); | |
} else if (window.getSelection().removeAllRanges) { // Firefox | |
window.getSelection().removeAllRanges(); | |
} | |
} else if (document.selection) { // IE? | |
document.selection.empty(); | |
} |
OlderNewer