Is it possible to read and write to values within values in a data store

Basically right now my game has 2 data stores for “Money” and “Unlocked Cosmetics”. They’re different datastores so that I don’t have to write over all the information in them whenever data is saved, ie. money is autosaved more often than the cosmetics. Is it possible to combine different kinds of data into 1 data store and only access or write over the data needed?

Basically could I set up a data store like this

[playerID] = {
	Money = 5,
	Level = 23
}

And then do something like this

DataStore:GetAsync(player.UserId["Money"])

To read and write over only the player’s “Money” value?
This is a very simple example but my game will eventually have more complicated data to save such as unlocked playable classes, unlocked cosmetics per that class, saved characters, etc, and it would be convenient to have fewer data stores that I can retrieve/save only the needed data from. For example “money” is a simple value that would autosave more frequently than other kinds of data so I’d like to be able to save over only a player’s money, without having to create a bunch of data stores for every different thing

You can switch to datastore2 which will let you combine values into one store while being able to edit them separately.

local success, result = pcall(function()
	return datastore:UpdateAsync(player.UserId, function(data)
		data.Money = player.leaderstats.Money.Value
		return data
	end)
end)

This is just an example code snippet.
“:UpdateAsync()” is specifically purposed for updating a datastore’s entries.

https://developer.roblox.com/en-us/api-reference/function/GlobalDataStore/UpdateAsync