198 Commits (36895421ba0f8ceae21efbaa324ac8da4794602a)

Author SHA1 Message Date
Peter Jaszkowiak 3361a72725 ESlint no-plusplus
and no-empty, space-unary-ops
8 years ago
Peter Jaszkowiak 2ba46808a1 ESlint one-var, fix comma-dangle 8 years ago
barisusakli e1253f693a fix redis union 8 years ago
barisusakli b71ab64cf4 organize dbal sorted code 8 years ago
Moritz Schmidt e8e33a8a23 ZSET scores are float: parseInt => parseFloat
In Redis, scores of sorted sets can be floats – so we should use `parseFloat` instead of `parseInt` when converting from string to number.
Should not lead to #4939 again, as `new Date()` works regardless of whether it's being passed a float or integer.
8 years ago
barisusakli 5d6e2ad083 multiple test fixes 8 years ago
barisusakli c8b5c181ff fix flag on redis
check if number is returned on tests
8 years ago
Barış Soner Uşaklı c512a02c83 Merge pull request #5124 from yariplus/lexistuff
Add additional lexical dbal operations.
8 years ago
yariplus af2122bdb9 fix lex tests maybe 8 years ago
barisusakli 4a0f67afdc search tests
new method emptydb
use emptydb instead of flushdb, flushdb  removes indices for mongo which
breaks search tests
initialize meta.config properly in tests
enable nodebb-plugin-dbsearch for tests
8 years ago
yariplus be3b35dea3 fix callbacks and regex 8 years ago
yariplus 1bb44e2429 Allow lex min and max to be inclusive or exclusive. 8 years ago
yariplus ef20757f3e zremrangebylex, zlexcount 8 years ago
yariplus 1fc5e5d0d3 getSortedSetRevRangeByLex 8 years ago
HeeL 4a3c31b2dc Fix space-before-function-paren linter rule 8 years ago
HeeL 3fa1c1f927 Fix space-infix-ops linter rule 8 years ago
barisusakli 0d09fcbee7 fix setAdd on redis for empty arrays 9 years ago
barisusakli 990ecc8cd2 sortedSetIntersectionCard 9 years ago
barisusakli e1263f1057 sortedSetUnionCard 9 years ago
barisusakli eabb745116 change union to match intersect
accept aggregate and withscores
9 years ago
barisusakli 3d56776ab0 fix tabs 9 years ago
barisusakli 6022fd984a closes #4945 9 years ago
barisusakli c8a369f5c3 closes #4939 9 years ago
barisusakli 018f7ba65a closes #4307
ability to send an array of keys to getSortedSetRange
use getSortedSetRevRange instead of getSortedSetRevUnion
9 years ago
barisusakli dcbf53bae3 moved search to dbsearch 9 years ago
barisusakli aa577f4adc part 1
no upgrade script yet
10 years ago
barisusakli 7b550b13b9 display both redis/mongo info if available 10 years ago
Barış Soner Uşaklı ba1afdf879 dont crash if callback isnt supplied fixes #3033 10 years ago
barisusakli fa9fde43fb closes #2971 10 years ago
barisusakli e2196af8ab part 2 of search changes 10 years ago
barisusakli c7128bcc98 part 1 of search change 10 years ago
barisusakli ec8fc8b97b dont do anything if id is falsy
added callback
10 years ago
psychobunny b0628c2df8 missing semi-colons in database/ 10 years ago
barisusakli 3bcd8aefb0 deleteObjectFields method
cleaned up user reset
10 years ago
Barış Soner Uşaklı 749ce5f8e5 dont crash if callback isnt supplied to list methods 10 years ago
barisusakli 39cac43b96 if key isn't found dont error
Conflicts:
	src/database/redis/main.js
10 years ago
barisusakli bd8a77a22b dont crash if callback isnt passed in 10 years ago
barisusakli 2c45dc6450 redis helpers 10 years ago
barisusakli c379753341 upgrade scripts
upgrade groups to sorted set(groups:createtime) upgrade
upgrade groups:<name>:members to sorted set
new database methods
tests
10 years ago
barisusakli 96c27d29f4 dont crash if callback isn't supplied 10 years ago
Julian Lam eb5b8ccec3 better check for group exist, groups with different cases can no longer be created, #2588 10 years ago
barisusakli f67053df52 figure out pathname, dont crash if callback isnt supplied 10 years ago
barisusakli 4d5ed784a1 more hash tests
getObjectValues
isObjectField
deleteObjectField
incrObjectField
10 years ago
barisusakli 3e8c29e5f9 list tests 10 years ago
barisusakli 1cbf5ddfe9 only send back err on redis.deleteAll 10 years ago
barisusakli 7cf3719c80 fix rename and increment 10 years ago
barisusakli bf54859a27 key tests 10 years ago
barisusakli 37235557bb fix callback in redis.setRemove 10 years ago
barisusakli 00fb3ab909 only send back error for sortedSetsRemove 10 years ago
barisusakli cd41e192d1 closes #2546 10 years ago
barisusakli 2f8e6a1f2b closes #2458 10 years ago
barisusakli 671ec8532c fix unfavourite 10 years ago
barisusakli 1d2d69fa45 use helpers, redis crash fix 10 years ago
barisusakli 0a44d3f5e0 moved updateCategoryField out, db.delete only sends back err 10 years ago
barisusakli 1fe82ee452 added 2 new methods to dbal
getSortedSetRangeWithScores
getSortedSetRangeByScoreWithScores
10 years ago
barisusakli 740c336480 typo 11 years ago
barisusakli dba20160ce check length 11 years ago
barisusakli 212e15b2c2 fixin redis zrevrangebyscore to return value score 11 years ago
barisusakli 5fc760c6c4 unread changes 11 years ago
barisusakli 9d25772b53 added sortedSetIncrBy 11 years ago
barisusakli c5c97c784a optimize getPostIndices
only use 1 set when its in a topic
11 years ago
barisusakli b1f492dec3 fix redis bulk zadd 11 years ago
barisusakli 4b80bbb9c4 optimized user.delete 11 years ago
barisusakli 31eccb8e7f configurable post delay before first post 11 years ago
barisusakli 35a903f9c8 closes #2074
when new notifications are pushed to uids clear their old notifications.
11 years ago
barisusakli 493d0dea1e part 1 of notif refactor 11 years ago
barisusakli 01f983e29c markAsRead improvement
takes in an array of tids instead of marking topics read 1 by 1
same for the category.markAsRead function
11 years ago
barisusakli 5222edb624 sortedSetsAdd
using mullti/bulk for redis/mongo
lets you add a score/value pair to multiple sorted sets at once
11 years ago
barisusakli 2252ab7479 notifications.prune
run every hour
dont get more than 500 notifications
11 years ago
barisusakli 84d0e64361 fix topic move 11 years ago
barisusakli 10b30e303b mongo posting fix 11 years ago
barisusakli cd096f8832 sortedSetScores for tag counts 11 years ago
barisusakli e10eaf0d50 added tag counts to api return 11 years ago
barisusakli 5e68e0b009 same deal as previous commit 11 years ago
barisusakli e137baccd9 fixed ip:recent weird 11 years ago
barisusakli 528ee335d5 optimize getTopicsByTids and getTeasers 11 years ago
barisusakli b4182f57fe simplified callback 11 years ago
barisusakli eeb4c9f487 optimize getPostSummaryByPids 11 years ago
barisusakli d7520508e3 #1375 part1 11 years ago
psychobunny 7327730252 LTRIM support for redis 11 years ago
barisusakli 3829019bfa removed optional params 11 years ago
barisusakli 89bb11a58c closes #1880 11 years ago
barisusakli 9aacb5e259 remove dupe code 11 years ago
barisusakli c3a9767bf6 late night optimizations
-isMemberOfSets returns true/false instead of 1/0
-when loading the posts of a topic only get the userdata for each user
once, before this commit if a topic had 10 posts from 2 different users
we were getting the user data for each user 5 times (drunk)
-getVoteStatusByPostIDs and getFavouritesByPostIDs no longer make
pids.length calls to the db, they use isMemberOfSets now
-getUserInfoForPost renamed to getUserInfoForPosts and doesnt make
uids.length calls to db, uses getMultipleUserFields instead
11 years ago
barisusakli d3fc71529a callback 11 years ago
barisusakli f80b3c3b66 simpler union 11 years ago
barisusakli 7f534cc7b8 sorted set refactor 11 years ago
barisusakli e6d8e9c959 searchIndex callbacks 11 years ago
barisusakli fd12ec763a sortedSetsRemove
instead of calling sortedSetRemove() one at a time for each id remove
value from multiple sortedSets with one db call
11 years ago
Charles 90b2d766f7 Fix callback execution in redis search
`callback` should be passed to `reds.search` otherwise the execution will be overlapped. 

For example in the plugin `nodebb-plugin-dbsearch':

```javascript
db.searchRemove('topic', tid, function() {
	if (typeof title === 'string' && title.length) {
		db.searchIndex('topic', title, tid);
	}

	if (typeof callback === 'function') {
		callback();
	}
});
```

The actual execution is like this

```
1402387863.625553 [0 127.0.0.1:16660] "zrevrangebyscore" "nodebbtopicsearch:object:6" "+inf" "0"
1402387863.625891 [0 127.0.0.1:16660] "MULTI"
1402387863.626043 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:123" "1" "6"
1402387863.626052 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "123"
1402387863.626060 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TST" "1" "6"
1402387863.626065 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TST"
1402387863.626071 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:AN0" "1" "6"
1402387863.626076 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "AN0"
1402387863.626083 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:TPK" "1" "6"
1402387863.626092 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "TPK"
1402387863.626104 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:word:ETTT" "1" "6"
1402387863.626116 [0 127.0.0.1:16660] "zadd" "nodebbtopicsearch:object:6" "1" "ETTT"
1402387863.626130 [0 127.0.0.1:16660] "EXEC"
1402387863.626253 [0 127.0.0.1:16660] "del" "topic:6:tags"
1402387863.626281 [0 127.0.0.1:16660] "MULTI"
1402387863.626515 [0 127.0.0.1:16660] "del" "nodebbtopicsearch:object:6"
1402387863.626524 [0 127.0.0.1:16660] "EXEC"
```

The key nodebbtopicsearch:object is added and then just being deleted again.
11 years ago
Julian Lam 7afe3bea59 added getSortedSetRevUnion... just because. 11 years ago
Julian Lam 6e597a9cdb fixed tests, and added getSortedSetUnion method to redis db, added test for new redis method 11 years ago
barisusakli 746df87d89 upgrade tags to sorted set 11 years ago
Julian Lam e64c1bfec3 closed #1453 11 years ago
Julian Lam bab140c396 added pexpire and pexpireAt methods for redis and mongo. Added emoticons for leveldb (as per existing implementation by @psychobunny LOL) 11 years ago
psychobunny 290e348851 move database helpers into their own files 11 years ago
psychobunny bba3df6802 moving db.close into the parent module 11 years ago
psychobunny 9ad7ce9ca8 organizing redis driver 11 years ago