MongoDB style filter and validation (github.com)
from gredo@lemmy.world to golang@programming.dev on 03 Sep 2023 06:39
https://lemmy.world/post/4362805

Hi,

is there a way to use MongoDB query syntax or something similar to filter arrays/slices or validate data in Go?

In (node)JS there’s Sift.js or (less MongoDB style) Underscore/lodash.

Possible use cases:

I’m relatively new to Go so maybe there already is a best practice to do stuff like that, I don’t know of.

#golang

threaded - newest

nnullzz@lemmy.world on 03 Sep 2023 20:47 collapse

Not sure about a MongoDB specific solution but maybe you can use go-funk for filtering slices that’s sort of Lodashish. Could be used as part of a full solution.