I am done with this. If somebody needs help for this topic, he/she may send a notification to me.
Custom Entity for User
Take a look at how we store users. We increment a global user id each time a new user is created and store the user data in an object with the name
user:<userId>and we store the userId in a sorted set. You need to do something similar for businesses.
Everytime a new business is created assign it a unique id and store it at
business:<businessId>and then also store it for the user at
It would look something like below in nodebb code. This is obviously pseudocode.
incr businessId in database setObject businness:bussinessId businessData sortedSetAdd uid:<uid>:businesses Date.now() businessId
Now you can retrieve a users business with the getSortedSetRange commands using the key
Copyright © 2023 NodeBB | Contributors