why hooks for database firing from all pages...?

I have a show_bike_page. There is a dataset connected to bike_collection. The name of dataset is loaddataset and also there is a hook (data.js) to convert some input data to uppercase. All is working well

Another page named save_bike_page. These is also a dataset connected to bike_collection. The name of dataset is savedataset without any hook. When I save any data here, the (data.js) hook fires…

How to stop hooks on save_bike_page to fire…?

Hooks are per collection. They have nothing to do with datasets.
If you want to get data from the collection without triggering the hook, you’ll need to use a direct query instead of a dataset, write the query in a jsw file in the backend and use {suppressHooks: true}.
like:

export function queryCollection(collectionName){
return wixData.query(collectionName)
.limit(1000)
.find({suppressHooks: true})
.then(r => {
return r;
})
}

import to the front end and that’s all

Thanks Expert, For quick and beneficial tips. :blush:

You’re welcome :slight_smile:

Would you please solve my issue…

I have two collection…

student_collection
_id sname mobile1
(system) MATHEW 123456789
(system) TOM 112233445

deposit_collection
_id s_id dep_amount
(system) data from student_collection(_id of MATHEW) 500
(system) data from student_collection(_id of MATHEW) 700
(system) data from student_collection(_id of TOM) 800

I want to show result in table element like these…
sname tot_amount
MATHEW 1200
TOM 800

how to do this… please suggest … thanks in advance

The easiest way will be to make s_id field type a reference field that contains the id from the student collection.
Then you’ll be able to query the deposit collection using .include(“s_id”) :

https://www.wix.com/corvid/reference/wix-data/wixdataquery/include