Mentality was an established set of attitudes perceived as normal or typical of a group's social or cultural values. This could include the worldview, philosophy, or frame of mind in a person. Mentality affected one's behaviors and choices.
In 2151, Captain Jonathan Archer took Trip Tucker's advice about thinking like a Klingon. Archer browsed the Vulcan database which had about nine hundred pages on Klingons and he learned that Klingons were driven by a warrior mentality, and tended to view anyone they meet as a potential enemy. (ENT: "Sleeping Dogs")
In 2286, Leonard McCoy stated that the only constant in the universe was the bureaucratic mentality. (Star Trek IV: The Voyage Home)
In 2374, Ensign Harry Kim complained to Commander Chakotay that Seven of Nine took hive mentality too far with designated functions and crewmembers being numbered like drones. Seven provided Dell with a new designation Three of Ten, and Kim was designated Six of Ten which he didn't want to be called. Kim was demoted to Two of Ten for compromising productivity. (VOY: "The Omega Directive")
According to the script for Star Trek II: The Wrath of Khan, after taking the Kobayashi Maru test for the third time, Spock said to Kirk that his solution would not have occurred to a Vulcan mentality. [1]