Tech Jobs Be Like
  • noornee noornee Now 100%

    gottem lmao

    5
  • autocmd is breaking my lsp and not working
  • noornee noornee Now 100%

    hii, I'm not well versed with neovim but i just tried out your autocmd and it worked after i replaced "callback" with "command"

    callback accepts (Lua function or Vimscript function name string) while

    command accepts (Ex command string).

    check :h nvim_create_autocmd() for more info

    1
  • i currently use Iosevka Nerd Font. the cancel icon (X) looks too big and i want to change it to lowercase (x). i looked through the [nvim-web-devicons](https://github.com/nvim-tree/nvim-web-devicons) readme and i also tried printing out all the available icons there i.e. ```lua local devicons = require("nvim-web-devicons").get_icons() for _, value in pairs(devicons) do for i, v in pairs(value) do print(i .. "==>" .. v .. "\n") end end ``` but i couldnt find an icon with a name that matches X or cancel. what can i do to override this and replace with a custom one? [edit] i use [barbar.nvim](https://github.com/romgrk/barbar.nvim) for buffers btw. i just tried [akinsho/bufferline](https://github.com/akinsho/bufferline.nvim) and the cancel icon looked normal. i suppose this is a barbar issue [edit]: okay turns out it was a barbar issue. just had to read through the `README.md` properly haha. ``` M.config = function() require("barbar").setup({ icons = { button = "x", -- customize it to anything }, }) end ```

    6
    2
    a bson struct tag to create a unique index just like gorm
  • noornee noornee Now 100%

    Hello, Thanks for responding. ^^

    i didn't want to make any changes to the id field.

    i have a user struct like this.

    type User struct {
    	ID         primitive.ObjectID `bson:"_id,omitempty" json:"id"`
    	FirstName  string             `bson:"firstname" json:"firstname"`
    	LastName   string             `bson:"lastname" json:"lastname"`
    	Email      string             `bson:"email" index:"email" json:"email"`
     }
    
    

    i wanted the Email field to be unique, just like the ID. so when a new user tries to create an account with the same email, it'll return an error.

    it isn't a problem anymore because i figured out a way... i created a custom struct tag that validates whether a user with the same email exist in the database.

    1
  • I'm trying to find a bson struct tag to create a unique index just like the one in the image attached to this post but for mongodb. i tried searching and i found nothing Close to what i need but this stackoverflow post https://stackoverflow.com/questions/30831316/how-to-specify-a-struct-with-a-multi-column-unique-index-for-gorm

    2
    3
    noornee Now
    3 4

    noornee

    lemmy.ml