this post was submitted on 03 Sep 2023
1 points (100.0% liked)

Golang

2434 readers
9 users here now

This is a community dedicated to the go programming language.

Useful Links:

Rules:

founded 2 years ago
MODERATORS
 

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:

  • Easily readable validation syntax (at least for people knowing MongoDB)
  • mocking a MongoDB for dev purposes
  • filtering arrays/slices more easily

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

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here