mongod --repair --dbpath /PATH_TO_DB
This resolved this error message:
"Assertion failure isOk() src/mongo/db/storage/mmap_v1/extent.h 81"
2018-02-10
MacOS - Get file or folder absolute path copied to the clipboard
(1) Select a file or folder using Finder
(2) Press COMMAND + OPTION + C
(2) Press COMMAND + OPTION + C
2018-02-09
2018-02-07
MongoDB - Upgrade standalone from v3.4 to v3.6
// Set the feature compatibility version to 3.4
db.adminCommand( { getParameter: 1, featureCompatibilityVersion: 1 } );
db.adminCommand( { setFeatureCompatibilityVersion: "3.4" } )
// Test and let your application season for a while
// Once convinced everything works, then set features compatibility version to 3.6
db.adminCommand( { setFeatureCompatibilityVersion: "3.6" } )
2018-01-06
MongoDB - Aggregation, simple group by single field with frequency count
db.[COLLECTION_NAME].aggregate([
{"$group" : {_id:"$FIELD_TO_GROUP_BY", count:{$sum:1}}}
])
{"$group" : {_id:"$FIELD_TO_GROUP_BY", count:{$sum:1}}}
])
2017-11-08
MySQL - Select date with microseconds precision
SELECT DATE_FORMAT( CURRENT_TIMESTAMP, "%W %M %e %Y %f");
SELECT now(6);
SELECT MICROSECOND(now(6));
SELECT now(6);
SELECT MICROSECOND(now(6));
2017-10-12
Python - Replace three consecutive dot-space strings (. . . ) with triple dot (...)
import re
str = "This is one . . . . . This is two. And other."
print re.sub( r'((\. )\2{2,2})', '...', str)
str = "This is one . . . . . This is two. And other."
print re.sub( r'((\. )\2{2,2})', '...', str)
Subscribe to:
Posts (Atom)