-1

In Gorm we can use DB.Where to check the data of the user from the database for authentication. But I have to use Go Fiber so what can I use in place of DB.Where to check if the user is present in the database.

var user models.User    
database.DB.Where("id = ?", claims.Issuer).(&user)
jps
  • 20,041
  • 15
  • 75
  • 79
S H A S H A N K
  • 118
  • 2
  • 23

2 Answers2

0

Well, as per your question gorm is working as a database also as a framework.

you can use go fiber as a framework but if you want to use the database you cannot use the database from fiber instead you have to use a database from which you can find the collection of the data in the database.

For example, you are using MongoDB with GoFiber so it will use the method of DB.Collection.FindOne()

In form Db.Where is used to find the database collection

0
Well, as per your question gorm is working as a database also as a framework.

you can use go fiber as a framework but if you want to use the database you cannot use the database from fiber instead you have to use a database from which you can find the collection of the data in the database.

For example, you are using MongoDB with GoFiber so it will use the method of DB.Collection.FindOne()

In form Db.Where is used to find the database collection